diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-09-03 22:51:02 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-09-03 22:51:02 +0400 |
commit | f8c29c999f0f0a6ed7e8a8ba1de444fdc5bdd3f2 (patch) | |
tree | cb3f23b3d33b7a991f17020dde7c1d4eb26c2e58 /intern/cycles/kernel/osl | |
parent | 9b30e8d83ac1294bb7a0956d57f5d00d61df703f (diff) |
Fix for Cycles OSL: The RenderServices pointer in ShadingSystem is no longer accessible from the interface class (presumably because it is just the base class pointer anyway and would have to be casted). The OSLRenderServices pointer to our own implementation is now stored alongside the ShadingSystem in the kernel globals, so it can be accessed in thread_init.
Diffstat (limited to 'intern/cycles/kernel/osl')
-rw-r--r-- | intern/cycles/kernel/osl/osl_globals.h | 3 | ||||
-rw-r--r-- | intern/cycles/kernel/osl/osl_shader.cpp | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/intern/cycles/kernel/osl/osl_globals.h b/intern/cycles/kernel/osl/osl_globals.h index 9a7985d6e95..075c68824e6 100644 --- a/intern/cycles/kernel/osl/osl_globals.h +++ b/intern/cycles/kernel/osl/osl_globals.h @@ -30,12 +30,15 @@ CCL_NAMESPACE_BEGIN +class OSLRenderServices; + struct OSLGlobals { /* use */ bool use; /* shading system */ OSL::ShadingSystem *ss; + OSLRenderServices *services; /* shader states */ vector<OSL::ShadingAttribStateRef> surface_state; diff --git a/intern/cycles/kernel/osl/osl_shader.cpp b/intern/cycles/kernel/osl/osl_shader.cpp index bf615f673cf..345614c2868 100644 --- a/intern/cycles/kernel/osl/osl_shader.cpp +++ b/intern/cycles/kernel/osl/osl_shader.cpp @@ -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) |