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.
This commit is contained in:
@@ -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;
|
||||
|
@@ -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)
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user