The shader id generated by the manager contains some special flags in high bits,...
authorLukas Toenne <lukas.toenne@googlemail.com>
Mon, 3 Sep 2012 18:50:59 +0000 (18:50 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Mon, 3 Sep 2012 18:50:59 +0000 (18:50 +0000)
intern/cycles/render/osl.cpp

index 04af9b48280186dbb4b351b5acdf8ead20581695..8bf32fdcb1a4dcb178aaafdecb40474108be79ea 100644 (file)
@@ -102,7 +102,7 @@ void OSLShaderManager::device_update(Device *device, DeviceScene *dscene, Scene
        /* setup shader engine */
        og->ss = ss;
        int background_id = scene->shader_manager->get_shader_id(scene->default_background);
-       og->background_state = og->surface_state[background_id];
+       og->background_state = og->surface_state[background_id & SHADER_MASK];
        og->use = true;
 
        tls_create(OSLGlobals::ThreadData, og->thread_data);