Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-01-31 12:39:19 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-01-31 12:39:19 +0300
commit03cb146afa812c95acf0da7f30b3282e71bffcf0 (patch)
tree910f4a790d64cd05fad0ea280bd0ed0a6c64584a /intern
parent3f5771475d55ed981bd98ee5810e62b68bccbb38 (diff)
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.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/kernel/geom/geom_attribute.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/intern/cycles/kernel/geom/geom_attribute.h b/intern/cycles/kernel/geom/geom_attribute.h
index 2ade0df768f..9ac16e86085 100644
--- a/intern/cycles/kernel/geom/geom_attribute.h
+++ b/intern/cycles/kernel/geom/geom_attribute.h
@@ -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);
}