Fix Cycles assert with mix weights outside of 0..1 range

This could result in wrong skipping of SVM nodes in the graph. Now make the
logic consistent with the clamping in the OSL implementation and constant
folding.

Thanks to Christophe Hery for finding the problem and providing the fix.
This commit is contained in:
Brecht Van Lommel
2022-06-28 19:11:14 +02:00
parent 814f360c83
commit c257443192

View File

@@ -264,11 +264,11 @@ ccl_device void svm_eval_nodes(KernelGlobals kg,
svm_node_mix_closure(sd, stack, node);
break;
case NODE_JUMP_IF_ZERO:
if (stack_load_float(stack, node.z) == 0.0f)
if (stack_load_float(stack, node.z) <= 0.0f)
offset += node.y;
break;
case NODE_JUMP_IF_ONE:
if (stack_load_float(stack, node.z) == 1.0f)
if (stack_load_float(stack, node.z) >= 1.0f)
offset += node.y;
break;
case NODE_GEOMETRY: