diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-07-28 19:27:25 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-07-28 20:27:57 +0300 |
commit | 073bf8bf52edbb6f53fb6bbbecc26f20b91e8c43 (patch) | |
tree | 109ca52ccec690c7a639ea70ac00f68d3ee9fae8 /intern/cycles/kernel/kernel_accumulate.h | |
parent | 3bf96758496973c1bcf2226324552ee1b9bf95f3 (diff) |
Cycles: remove WITH_CYCLES_DEBUG, add WITH_CYCLES_DEBUG_NAN
WITH_CYCLES_DEBUG was used for rendering BVH debugging passes. But since we
mainly use Embree an OptiX now, this information is no longer important.
WITH_CYCLES_DEBUG_NAN will enable additional checks for NaNs and invalid values
in the kernel, for Cycles developers. Previously these asserts where enabled in
all debug builds, but this is too likely to crash Blender in scenes that render
fine regardless of the NaNs. So this is behind a CMake option now.
Fixes T90240
Diffstat (limited to 'intern/cycles/kernel/kernel_accumulate.h')
-rw-r--r-- | intern/cycles/kernel/kernel_accumulate.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/intern/cycles/kernel/kernel_accumulate.h b/intern/cycles/kernel/kernel_accumulate.h index 76e0f2be02c..61653d328f1 100644 --- a/intern/cycles/kernel/kernel_accumulate.h +++ b/intern/cycles/kernel/kernel_accumulate.h @@ -225,13 +225,6 @@ ccl_device_inline void path_radiance_init(KernelGlobals *kg, PathRadiance *L) L->denoising_albedo = zero_float3(); L->denoising_depth = 0.0f; #endif - -#ifdef __KERNEL_DEBUG__ - L->debug_data.num_bvh_traversed_nodes = 0; - L->debug_data.num_bvh_traversed_instances = 0; - L->debug_data.num_bvh_intersections = 0; - L->debug_data.num_ray_bounces = 0; -#endif } ccl_device_inline void path_radiance_bsdf_bounce(KernelGlobals *kg, @@ -595,7 +588,9 @@ ccl_device_inline void path_radiance_sum_shadowcatcher(KernelGlobals *kg, float shadow; if (UNLIKELY(!isfinite_safe(path_total))) { +# ifdef __KERNEL_DEBUG_NAN__ kernel_assert(!"Non-finite total radiance along the path"); +# endif shadow = 0.0f; } else if (path_total == 0.0f) { @@ -641,7 +636,9 @@ ccl_device_inline float3 path_radiance_clamp_and_sum(KernelGlobals *kg, /* Reject invalid value */ if (!isfinite_safe(sum)) { +# ifdef __KERNEL_DEBUG_NAN__ kernel_assert(!"Non-finite sum in path_radiance_clamp_and_sum!"); +# endif L_sum = zero_float3(); L->direct_diffuse = zero_float3(); @@ -667,7 +664,9 @@ ccl_device_inline float3 path_radiance_clamp_and_sum(KernelGlobals *kg, /* Reject invalid value */ float sum = fabsf((L_sum).x) + fabsf((L_sum).y) + fabsf((L_sum).z); if (!isfinite_safe(sum)) { +#ifdef __KERNEL_DEBUG_NAN__ kernel_assert(!"Non-finite final sum in path_radiance_clamp_and_sum!"); +#endif L_sum = zero_float3(); } } |