forked from bartvdbraak/blender
The shader id generated by the manager contains some special flags in high bits, leading to out-of-range index if used directly. This must use the SHADER_MASK to get actual array index.
This commit is contained in:
parent
192935eb04
commit
9b30e8d83a
@ -102,7 +102,7 @@ void OSLShaderManager::device_update(Device *device, DeviceScene *dscene, Scene
|
|||||||
/* setup shader engine */
|
/* setup shader engine */
|
||||||
og->ss = ss;
|
og->ss = ss;
|
||||||
int background_id = scene->shader_manager->get_shader_id(scene->default_background);
|
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;
|
og->use = true;
|
||||||
|
|
||||||
tls_create(OSLGlobals::ThreadData, og->thread_data);
|
tls_create(OSLGlobals::ThreadData, og->thread_data);
|
||||||
|
Loading…
Reference in New Issue
Block a user