diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-29 02:39:15 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-29 02:39:15 +0400 |
commit | 3f39af9cc2765c2cf3daab30c4ad0be58e341e19 (patch) | |
tree | 3054bd190552c794daf448e93e55bc69465d6b85 | |
parent | fe222643b4a53fae38bc5ead86551b99abbdc583 (diff) |
Fix cycles volume render crash when trying to access primitive attributes
like generated texture coordinates or tangents.
-rw-r--r-- | intern/cycles/kernel/kernel_primitive.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_attribute.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_primitive.h b/intern/cycles/kernel/kernel_primitive.h index 0e39c489fbc..5a050c443da 100644 --- a/intern/cycles/kernel/kernel_primitive.h +++ b/intern/cycles/kernel/kernel_primitive.h @@ -23,7 +23,7 @@ CCL_NAMESPACE_BEGIN ccl_device_inline int find_attribute(KernelGlobals *kg, ShaderData *sd, uint id, AttributeElement *elem) { - if(sd->object == ~0) + if(sd->object == ~0 || sd->prim == ~0) return (int)ATTR_STD_NOT_FOUND; #ifdef __OSL__ diff --git a/intern/cycles/kernel/svm/svm_attribute.h b/intern/cycles/kernel/svm/svm_attribute.h index 90409e16477..4c53bfd74fa 100644 --- a/intern/cycles/kernel/svm/svm_attribute.h +++ b/intern/cycles/kernel/svm/svm_attribute.h @@ -22,7 +22,7 @@ ccl_device void svm_node_attr_init(KernelGlobals *kg, ShaderData *sd, uint4 node, NodeAttributeType *type, NodeAttributeType *mesh_type, AttributeElement *elem, int *offset, uint *out_offset) { - if(sd->object != ~0) { + if(sd->object != ~0 && sd->prim != ~0) { /* find attribute by unique id */ uint id = node.y; uint attr_offset = sd->object*kernel_data.bvh.attributes_map_stride; |