forked from bartvdbraak/blender
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:
parent
3f5771475d
commit
03cb146afa
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user