Fix T43496: Infinite loop in kernel when using surface attribute for volume

The issue was caused bu the optimization in surface attributes for cases when
there's only a volume shader used. Some attributes doesn't make sense in that
case and were skipped from calculation.

However, it is possible that kernel would still try to access them (because of
the shader setup etc). Prevented an infinite loop in the kernel now, which
should not have much affect on regular renders.
This commit is contained in:
Sergey Sharybin 2015-01-31 14:39:19 +05:00
parent 3f5771475d
commit 03cb146afa
Notes: blender-bot 2023-02-14 09:33:07 +01:00
Referenced by issue #43534, Face "Rotation" Not Preserved by Mirror Modifier
Referenced by issue #43496, OpenGL Driver losing connection with display using certain volumetric shader node configurations
1 changed files with 3 additions and 0 deletions

View File

@ -40,6 +40,9 @@ ccl_device_inline int find_attribute(KernelGlobals *kg, const ShaderData *sd, ui
uint4 attr_map = kernel_tex_fetch(__attributes_map, attr_offset);
while(attr_map.x != id) {
if(UNLIKELY(attr_map.x == ATTR_STD_NONE)) {
return ATTR_STD_NOT_FOUND;
}
attr_offset += ATTR_PRIM_TYPES;
attr_map = kernel_tex_fetch(__attributes_map, attr_offset);
}