diff options
Diffstat (limited to 'intern/cycles/kernel/closure')
-rw-r--r-- | intern/cycles/kernel/closure/alloc.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/intern/cycles/kernel/closure/alloc.h b/intern/cycles/kernel/closure/alloc.h index 1cf06614f3b..f1af3b12269 100644 --- a/intern/cycles/kernel/closure/alloc.h +++ b/intern/cycles/kernel/closure/alloc.h @@ -53,6 +53,9 @@ ccl_device_inline ccl_private ShaderClosure *bsdf_alloc(ccl_private ShaderData * { kernel_assert(isfinite_safe(weight)); + /* No negative weights allowed. */ + weight = max(weight, zero_float3()); + const float sample_weight = fabsf(average(weight)); /* Use comparison this way to help dealing with non-finite weight: if the average is not finite |