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
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2022-06-28 20:11:14 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-06-28 20:13:57 +0300
commitc257443192238e85e482908f1638c7edc0979f2e (patch)
treedad7e1251688f345c610d364c9d10d2f7d218c1c /intern/cycles/kernel/svm
parent814f360c83700496cd3e20cd8f264c5fce6749d7 (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.
Diffstat (limited to 'intern/cycles/kernel/svm')
-rw-r--r--intern/cycles/kernel/svm/svm.h4
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: