diff options
Diffstat (limited to 'intern/cycles/kernel/closure/alloc.h')
-rw-r--r-- | intern/cycles/kernel/closure/alloc.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/intern/cycles/kernel/closure/alloc.h b/intern/cycles/kernel/closure/alloc.h index 5b74a868e72..99a5a675976 100644 --- a/intern/cycles/kernel/closure/alloc.h +++ b/intern/cycles/kernel/closure/alloc.h @@ -57,6 +57,8 @@ ccl_device ccl_addr_space void *closure_alloc_extra(ShaderData *sd, int size) ccl_device_inline ShaderClosure *bsdf_alloc(ShaderData *sd, int size, float3 weight) { + kernel_assert(isfinite3_safe(weight)); + const float sample_weight = fabsf(average(weight)); /* Use comparison this way to help dealing with non-finite weight: if the average is not finite @@ -81,6 +83,8 @@ ccl_device_inline ShaderClosure *bsdf_alloc_osl(ShaderData *sd, float3 weight, void *data) { + kernel_assert(isfinite3_safe(weight)); + const float sample_weight = fabsf(average(weight)); /* Use comparison this way to help dealing with non-finite weight: if the average is not finite |