[Bf-blender-cvs] [91f1886] master: Fix T46352: Cycles fails to render when material contains UV mapped texture as volume input

Sergey Sharybin noreply at git.blender.org
Mon Oct 5 11:47:44 CEST 2015


Commit: 91f1886b8e010bdac32e8dbe6c244b7ff8b46abb
Author: Sergey Sharybin
Date:   Mon Oct 5 14:45:03 2015 +0500
Branches: master
https://developer.blender.org/rB91f1886b8e010bdac32e8dbe6c244b7ff8b46abb

Fix T46352: Cycles fails to render when material contains UV mapped texture as volume input

===================================================================

M	intern/cycles/kernel/svm/svm_attribute.h

===================================================================

diff --git a/intern/cycles/kernel/svm/svm_attribute.h b/intern/cycles/kernel/svm/svm_attribute.h
index 025ae96..63bbb27 100644
--- a/intern/cycles/kernel/svm/svm_attribute.h
+++ b/intern/cycles/kernel/svm/svm_attribute.h
@@ -22,6 +22,8 @@ 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)
 {
+	*out_offset = node.z;
+	*type = (NodeAttributeType)node.w;
 	if(ccl_fetch(sd, object) != OBJECT_NONE) {
 		/* find attribute by unique id */
 		uint id = node.y;
@@ -32,6 +34,12 @@ ccl_device void svm_node_attr_init(KernelGlobals *kg, ShaderData *sd,
 		uint4 attr_map = kernel_tex_fetch(__attributes_map, attr_offset);
 		
 		while(attr_map.x != id) {
+			if(UNLIKELY(attr_map.x == ATTR_STD_NONE)) {
+				*elem = ATTR_ELEMENT_NONE;
+				*offset = 0;
+				*mesh_type = (NodeAttributeType)node.w;
+				return;
+			}
 			attr_offset += ATTR_PRIM_TYPES;
 			attr_map = kernel_tex_fetch(__attributes_map, attr_offset);
 		}
@@ -47,9 +55,6 @@ ccl_device void svm_node_attr_init(KernelGlobals *kg, ShaderData *sd,
 		*offset = 0;
 		*mesh_type = (NodeAttributeType)node.w;
 	}
-
-	*out_offset = node.z;
-	*type = (NodeAttributeType)node.w;
 }
 
 ccl_device void svm_node_attr(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node)




More information about the Bf-blender-cvs mailing list