diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-06-28 20:11:14 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-06-28 20:13:57 +0300 |
commit | c257443192238e85e482908f1638c7edc0979f2e (patch) | |
tree | dad7e1251688f345c610d364c9d10d2f7d218c1c | |
parent | 814f360c83700496cd3e20cd8f264c5fce6749d7 (diff) |
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.
-rw-r--r-- | intern/cycles/kernel/svm/svm.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/kernel/svm/svm.h b/intern/cycles/kernel/svm/svm.h index 624ef810e85..8fd41ec8531 100644 --- a/intern/cycles/kernel/svm/svm.h +++ b/intern/cycles/kernel/svm/svm.h @@ -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: |