Fix for Cycles OSL: The RenderServices pointer in ShadingSystem is no longer accessib...
authorLukas Toenne <lukas.toenne@googlemail.com>
Mon, 3 Sep 2012 18:51:02 +0000 (18:51 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Mon, 3 Sep 2012 18:51:02 +0000 (18:51 +0000)
intern/cycles/kernel/osl/osl_globals.h
intern/cycles/kernel/osl/osl_shader.cpp
intern/cycles/render/osl.cpp

index 9a7985d6e95f23803a6c056ea50d8724439a3400..075c68824e639ce581c650091ac3d2284d33617f 100644 (file)
 
 CCL_NAMESPACE_BEGIN
 
+class OSLRenderServices;
+
 struct OSLGlobals {
        /* use */
        bool use;
 
        /* shading system */ 
        OSL::ShadingSystem *ss;
+       OSLRenderServices *services;
 
        /* shader states */
        vector<OSL::ShadingAttribStateRef> surface_state;
index bf615f673cfea03fac02ff27085a6fceffe0bf5f..345614c2868450e5ca9ffd7d93e677e8052140c5 100644 (file)
@@ -45,9 +45,7 @@ void OSLShader::thread_init(KernelGlobals *kg)
 
        tls_set(kg->osl.thread_data, tdata);
 
-       //((OSLRenderServices *)ssi->renderer())->thread_init(kg);
-       /* XXX not sure here - dingto */
-       thread_init(kg);
+       kg->osl.services->thread_init(kg);
 }
 
 void OSLShader::thread_free(KernelGlobals *kg)
index 8bf32fdcb1a4dcb178aaafdecb40474108be79ea..d4c93c07e2ff061b48fc7f58a92b19e2ae23143e 100644 (file)
@@ -101,6 +101,7 @@ void OSLShaderManager::device_update(Device *device, DeviceScene *dscene, Scene
 
        /* setup shader engine */
        og->ss = ss;
+       og->services = services;
        int background_id = scene->shader_manager->get_shader_id(scene->default_background);
        og->background_state = og->surface_state[background_id & SHADER_MASK];
        og->use = true;