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
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2021-07-28 19:27:25 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-07-28 20:27:57 +0300
commit073bf8bf52edbb6f53fb6bbbecc26f20b91e8c43 (patch)
tree109ca52ccec690c7a639ea70ac00f68d3ee9fae8 /intern
parent3bf96758496973c1bcf2226324552ee1b9bf95f3 (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')
-rw-r--r--intern/cycles/CMakeLists.txt6
-rw-r--r--intern/cycles/blender/addon/engine.py4
-rw-r--r--intern/cycles/blender/addon/properties.py24
-rw-r--r--intern/cycles/blender/addon/ui.py24
-rw-r--r--intern/cycles/blender/blender_python.cpp8
-rw-r--r--intern/cycles/blender/blender_sync.cpp24
-rw-r--r--intern/cycles/device/cuda/device_cuda_impl.cpp3
-rw-r--r--intern/cycles/device/device_optix.cpp12
-rw-r--r--intern/cycles/device/opencl/device_opencl_impl.cpp4
-rw-r--r--intern/cycles/kernel/CMakeLists.txt9
-rw-r--r--intern/cycles/kernel/bvh/bvh_traversal.h8
-rw-r--r--intern/cycles/kernel/bvh/bvh_types.h27
-rw-r--r--intern/cycles/kernel/kernel_accumulate.h13
-rw-r--r--intern/cycles/kernel/kernel_passes.h29
-rw-r--r--intern/cycles/kernel/kernel_path.h9
-rw-r--r--intern/cycles/kernel/kernel_types.h40
-rw-r--r--intern/cycles/render/buffers.cpp9
-rw-r--r--intern/cycles/render/film.cpp29
18 files changed, 11 insertions, 271 deletions
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index b01bf1bd1e2..381248e9bf1 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -307,9 +307,9 @@ if(WITH_CYCLES_LOGGING)
)
endif()
-# Debugging capabilities (debug passes etc).
-if(WITH_CYCLES_DEBUG)
- add_definitions(-DWITH_CYCLES_DEBUG)
+# NaN debugging
+if(WITH_CYCLES_DEBUG_NAN)
+ add_definitions(-DWITH_CYCLES_DEBUG_NAN)
endif()
if(NOT OPENIMAGEIO_PUGIXML_FOUND)
diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py
index dc53c4db48f..29f8cd8f8cd 100644
--- a/intern/cycles/blender/addon/engine.py
+++ b/intern/cycles/blender/addon/engine.py
@@ -262,10 +262,6 @@ def list_render_passes(scene, srl):
# Cycles specific passes.
crl = srl.cycles
if crl.pass_debug_render_time: yield ("Debug Render Time", "X", 'VALUE')
- if crl.pass_debug_bvh_traversed_nodes: yield ("Debug BVH Traversed Nodes", "X", 'VALUE')
- if crl.pass_debug_bvh_traversed_instances: yield ("Debug BVH Traversed Instances", "X", 'VALUE')
- if crl.pass_debug_bvh_intersections: yield ("Debug BVH Intersections", "X", 'VALUE')
- if crl.pass_debug_ray_bounces: yield ("Debug Ray Bounces", "X", 'VALUE')
if crl.pass_debug_sample_count: yield ("Debug Sample Count", "X", 'VALUE')
if crl.use_pass_volume_direct: yield ("VolumeDir", "RGB", 'COLOR')
if crl.use_pass_volume_indirect: yield ("VolumeInd", "RGB", 'COLOR')
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 70f091158d2..4cd75edee5f 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -1325,30 +1325,6 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
- pass_debug_bvh_traversed_nodes: BoolProperty(
- name="Debug BVH Traversed Nodes",
- description="Store Debug BVH Traversed Nodes pass",
- default=False,
- update=update_render_passes,
- )
- pass_debug_bvh_traversed_instances: BoolProperty(
- name="Debug BVH Traversed Instances",
- description="Store Debug BVH Traversed Instances pass",
- default=False,
- update=update_render_passes,
- )
- pass_debug_bvh_intersections: BoolProperty(
- name="Debug BVH Intersections",
- description="Store Debug BVH Intersections",
- default=False,
- update=update_render_passes,
- )
- pass_debug_ray_bounces: BoolProperty(
- name="Debug Ray Bounces",
- description="Store Debug Ray Bounces pass",
- default=False,
- update=update_render_passes,
- )
pass_debug_render_time: BoolProperty(
name="Debug Render Time",
description="Render time in milliseconds per sample and pixel",
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 058528aeff5..e9a4ce77080 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -936,29 +936,6 @@ class CYCLES_RENDER_PT_passes_crypto(CyclesButtonsPanel, ViewLayerCryptomattePan
bl_parent_id = "CYCLES_RENDER_PT_passes"
-class CYCLES_RENDER_PT_passes_debug(CyclesButtonsPanel, Panel):
- bl_label = "Debug"
- bl_context = "view_layer"
- bl_parent_id = "CYCLES_RENDER_PT_passes"
-
- @classmethod
- def poll(cls, context):
- import _cycles
- return _cycles.with_cycles_debug
-
- def draw(self, context):
- layout = self.layout
- layout.use_property_split = True
- layout.use_property_decorate = False
-
- cycles_view_layer = context.view_layer.cycles
-
- layout.prop(cycles_view_layer, "pass_debug_bvh_traversed_nodes")
- layout.prop(cycles_view_layer, "pass_debug_bvh_traversed_instances")
- layout.prop(cycles_view_layer, "pass_debug_bvh_intersections")
- layout.prop(cycles_view_layer, "pass_debug_ray_bounces")
-
-
class CYCLES_RENDER_PT_passes_aov(CyclesButtonsPanel, ViewLayerAOVPanel):
bl_label = "Shader AOV"
bl_context = "view_layer"
@@ -2317,7 +2294,6 @@ classes = (
CYCLES_RENDER_PT_passes_data,
CYCLES_RENDER_PT_passes_light,
CYCLES_RENDER_PT_passes_crypto,
- CYCLES_RENDER_PT_passes_debug,
CYCLES_RENDER_PT_passes_aov,
CYCLES_RENDER_PT_filter,
CYCLES_RENDER_PT_override,
diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp
index c58d2eb6e04..fd145effde7 100644
--- a/intern/cycles/blender/blender_python.cpp
+++ b/intern/cycles/blender/blender_python.cpp
@@ -1098,14 +1098,6 @@ void *CCL_python_module_init()
PyModule_AddStringConstant(mod, "osl_version_string", "unknown");
#endif
-#ifdef WITH_CYCLES_DEBUG
- PyModule_AddObject(mod, "with_cycles_debug", Py_True);
- Py_INCREF(Py_True);
-#else
- PyModule_AddObject(mod, "with_cycles_debug", Py_False);
- Py_INCREF(Py_False);
-#endif
-
#ifdef WITH_NETWORK
PyModule_AddObject(mod, "with_network", Py_True);
Py_INCREF(Py_True);
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp
index ce399579e25..298353203ad 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -538,12 +538,6 @@ PassType BlenderSync::get_pass_type(BL::RenderPass &b_pass)
MAP_PASS("BakePrimitive", PASS_BAKE_PRIMITIVE);
MAP_PASS("BakeDifferential", PASS_BAKE_DIFFERENTIAL);
-#ifdef __KERNEL_DEBUG__
- MAP_PASS("Debug BVH Traversed Nodes", PASS_BVH_TRAVERSED_NODES);
- MAP_PASS("Debug BVH Traversed Instances", PASS_BVH_TRAVERSED_INSTANCES);
- MAP_PASS("Debug BVH Intersections", PASS_BVH_INTERSECTIONS);
- MAP_PASS("Debug Ray Bounces", PASS_RAY_BOUNCES);
-#endif
MAP_PASS("Debug Render Time", PASS_RENDER_TIME);
MAP_PASS("AdaptiveAuxBuffer", PASS_ADAPTIVE_AUX_BUFFER);
MAP_PASS("Debug Sample Count", PASS_SAMPLE_COUNT);
@@ -641,24 +635,6 @@ vector<Pass> BlenderSync::sync_render_passes(BL::Scene &b_scene,
}
}
-#ifdef __KERNEL_DEBUG__
- if (get_boolean(crl, "pass_debug_bvh_traversed_nodes")) {
- b_engine.add_pass("Debug BVH Traversed Nodes", 1, "X", b_view_layer.name().c_str());
- Pass::add(PASS_BVH_TRAVERSED_NODES, passes, "Debug BVH Traversed Nodes");
- }
- if (get_boolean(crl, "pass_debug_bvh_traversed_instances")) {
- b_engine.add_pass("Debug BVH Traversed Instances", 1, "X", b_view_layer.name().c_str());
- Pass::add(PASS_BVH_TRAVERSED_INSTANCES, passes, "Debug BVH Traversed Instances");
- }
- if (get_boolean(crl, "pass_debug_bvh_intersections")) {
- b_engine.add_pass("Debug BVH Intersections", 1, "X", b_view_layer.name().c_str());
- Pass::add(PASS_BVH_INTERSECTIONS, passes, "Debug BVH Intersections");
- }
- if (get_boolean(crl, "pass_debug_ray_bounces")) {
- b_engine.add_pass("Debug Ray Bounces", 1, "X", b_view_layer.name().c_str());
- Pass::add(PASS_RAY_BOUNCES, passes, "Debug Ray Bounces");
- }
-#endif
if (get_boolean(crl, "pass_debug_render_time")) {
b_engine.add_pass("Debug Render Time", 1, "X", b_view_layer.name().c_str());
Pass::add(PASS_RENDER_TIME, passes, "Debug Render Time");
diff --git a/intern/cycles/device/cuda/device_cuda_impl.cpp b/intern/cycles/device/cuda/device_cuda_impl.cpp
index cebe8ce631e..2d2fcb38705 100644
--- a/intern/cycles/device/cuda/device_cuda_impl.cpp
+++ b/intern/cycles/device/cuda/device_cuda_impl.cpp
@@ -351,9 +351,6 @@ string CUDADevice::compile_kernel_get_common_cflags(
if (extra_cflags) {
cflags += string(" ") + string(extra_cflags);
}
-# ifdef WITH_CYCLES_DEBUG
- cflags += " -D__KERNEL_DEBUG__";
-# endif
if (split) {
cflags += " -D__SPLIT__";
diff --git a/intern/cycles/device/device_optix.cpp b/intern/cycles/device/device_optix.cpp
index 392fec4d57b..6f9a7943722 100644
--- a/intern/cycles/device/device_optix.cpp
+++ b/intern/cycles/device/device_optix.cpp
@@ -234,9 +234,6 @@ class OptiXDevice : public CUDADevice {
}
};
# endif
-# if OPTIX_ABI_VERSION >= 41 && defined(WITH_CYCLES_DEBUG)
- options.validationMode = OPTIX_DEVICE_CONTEXT_VALIDATION_MODE_ALL;
-# endif
check_result_optix(optixDeviceContextCreate(cuContext, &options, &context));
# ifdef WITH_CYCLES_LOGGING
check_result_optix(optixDeviceContextSetLogCallback(
@@ -369,13 +366,8 @@ class OptiXDevice : public CUDADevice {
OptixModuleCompileOptions module_options = {};
module_options.maxRegisterCount = 0; // Do not set an explicit register limit
-# ifdef WITH_CYCLES_DEBUG
- module_options.optLevel = OPTIX_COMPILE_OPTIMIZATION_LEVEL_0;
- module_options.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_FULL;
-# else
module_options.optLevel = OPTIX_COMPILE_OPTIMIZATION_LEVEL_3;
module_options.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_LINEINFO;
-# endif
# if OPTIX_ABI_VERSION >= 41
module_options.boundValues = nullptr;
@@ -578,11 +570,7 @@ class OptiXDevice : public CUDADevice {
OptixPipelineLinkOptions link_options = {};
link_options.maxTraceDepth = 1;
-# ifdef WITH_CYCLES_DEBUG
- link_options.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_FULL;
-# else
link_options.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_LINEINFO;
-# endif
# if OPTIX_ABI_VERSION < 24
link_options.overrideUsesMotionBlur = motion_blur;
# endif
diff --git a/intern/cycles/device/opencl/device_opencl_impl.cpp b/intern/cycles/device/opencl/device_opencl_impl.cpp
index 715213175c9..31a2265700c 100644
--- a/intern/cycles/device/opencl/device_opencl_impl.cpp
+++ b/intern/cycles/device/opencl/device_opencl_impl.cpp
@@ -1968,10 +1968,6 @@ string OpenCLDevice::kernel_build_options(const string *debug_src)
build_options += "-D__KERNEL_OPENCL_DEBUG__ ";
}
-# ifdef WITH_CYCLES_DEBUG
- build_options += "-D__KERNEL_DEBUG__ ";
-# endif
-
# ifdef WITH_NANOVDB
if (info.has_nanovdb) {
build_options += "-DWITH_NANOVDB ";
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index db789d885f7..0ce33c51778 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -444,10 +444,6 @@ if(WITH_CYCLES_CUDA_BINARIES)
set(name ${name}_experimental)
endif()
- if(WITH_CYCLES_DEBUG)
- set(cuda_flags ${cuda_flags} -D __KERNEL_DEBUG__)
- endif()
-
if(WITH_NANOVDB)
set(cuda_flags ${cuda_flags}
-D WITH_NANOVDB
@@ -562,11 +558,6 @@ if(WITH_CYCLES_DEVICE_OPTIX AND WITH_CYCLES_CUDA_BINARIES)
--use_fast_math
-o ${output})
- if(WITH_CYCLES_DEBUG)
- set(cuda_flags ${cuda_flags}
- -D __KERNEL_DEBUG__)
- endif()
-
if(WITH_NANOVDB)
set(cuda_flags ${cuda_flags}
-D WITH_NANOVDB
diff --git a/intern/cycles/kernel/bvh/bvh_traversal.h b/intern/cycles/kernel/bvh/bvh_traversal.h
index 8b2699ab807..89250a8d60a 100644
--- a/intern/cycles/kernel/bvh/bvh_traversal.h
+++ b/intern/cycles/kernel/bvh/bvh_traversal.h
@@ -67,8 +67,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
isect->prim = PRIM_NONE;
isect->object = OBJECT_NONE;
- BVH_DEBUG_INIT();
-
/* traversal loop */
do {
do {
@@ -118,7 +116,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
--stack_ptr;
}
}
- BVH_DEBUG_NEXT_NODE();
}
/* if node is leaf, fetch triangle list */
@@ -138,7 +135,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
switch (type & PRIMITIVE_ALL) {
case PRIMITIVE_TRIANGLE: {
for (; prim_addr < prim_addr2; prim_addr++) {
- BVH_DEBUG_NEXT_INTERSECTION();
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
if (triangle_intersect(kg, isect, P, dir, visibility, object, prim_addr)) {
/* shadow ray early termination */
@@ -151,7 +147,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
#if BVH_FEATURE(BVH_MOTION)
case PRIMITIVE_MOTION_TRIANGLE: {
for (; prim_addr < prim_addr2; prim_addr++) {
- BVH_DEBUG_NEXT_INTERSECTION();
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
if (motion_triangle_intersect(
kg, isect, P, dir, ray->time, visibility, object, prim_addr)) {
@@ -169,7 +164,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
case PRIMITIVE_CURVE_RIBBON:
case PRIMITIVE_MOTION_CURVE_RIBBON: {
for (; prim_addr < prim_addr2; prim_addr++) {
- BVH_DEBUG_NEXT_INTERSECTION();
const uint curve_type = kernel_tex_fetch(__prim_type, prim_addr);
kernel_assert((curve_type & PRIMITIVE_ALL) == (type & PRIMITIVE_ALL));
const bool hit = curve_intersect(
@@ -201,8 +195,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
traversal_stack[stack_ptr] = ENTRYPOINT_SENTINEL;
node_addr = kernel_tex_fetch(__object_node, object);
-
- BVH_DEBUG_NEXT_INSTANCE();
}
}
} while (node_addr != ENTRYPOINT_SENTINEL);
diff --git a/intern/cycles/kernel/bvh/bvh_types.h b/intern/cycles/kernel/bvh/bvh_types.h
index 9f0879a2069..98e6ec25d15 100644
--- a/intern/cycles/kernel/bvh/bvh_types.h
+++ b/intern/cycles/kernel/bvh/bvh_types.h
@@ -42,33 +42,6 @@ CCL_NAMESPACE_BEGIN
#define BVH_FEATURE(f) (((BVH_FUNCTION_FEATURES) & (f)) != 0)
-/* Debugging helpers. */
-#ifdef __KERNEL_DEBUG__
-# define BVH_DEBUG_INIT() \
- do { \
- isect->num_traversed_nodes = 0; \
- isect->num_traversed_instances = 0; \
- isect->num_intersections = 0; \
- } while (0)
-# define BVH_DEBUG_NEXT_NODE() \
- do { \
- ++isect->num_traversed_nodes; \
- } while (0)
-# define BVH_DEBUG_NEXT_INTERSECTION() \
- do { \
- ++isect->num_intersections; \
- } while (0)
-# define BVH_DEBUG_NEXT_INSTANCE() \
- do { \
- ++isect->num_traversed_instances; \
- } while (0)
-#else /* __KERNEL_DEBUG__ */
-# define BVH_DEBUG_INIT()
-# define BVH_DEBUG_NEXT_NODE()
-# define BVH_DEBUG_NEXT_INTERSECTION()
-# define BVH_DEBUG_NEXT_INSTANCE()
-#endif /* __KERNEL_DEBUG__ */
-
CCL_NAMESPACE_END
#endif /* __BVH_TYPES__ */
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();
}
}
diff --git a/intern/cycles/kernel/kernel_passes.h b/intern/cycles/kernel/kernel_passes.h
index 52be2ed87b7..8f58b8c3079 100644
--- a/intern/cycles/kernel/kernel_passes.h
+++ b/intern/cycles/kernel/kernel_passes.h
@@ -122,31 +122,6 @@ ccl_device_inline void kernel_update_denoising_features(KernelGlobals *kg,
}
#endif /* __DENOISING_FEATURES__ */
-#ifdef __KERNEL_DEBUG__
-ccl_device_inline void kernel_write_debug_passes(KernelGlobals *kg,
- ccl_global float *buffer,
- PathRadiance *L)
-{
- int flag = kernel_data.film.pass_flag;
- if (flag & PASSMASK(BVH_TRAVERSED_NODES)) {
- kernel_write_pass_float(buffer + kernel_data.film.pass_bvh_traversed_nodes,
- L->debug_data.num_bvh_traversed_nodes);
- }
- if (flag & PASSMASK(BVH_TRAVERSED_INSTANCES)) {
- kernel_write_pass_float(buffer + kernel_data.film.pass_bvh_traversed_instances,
- L->debug_data.num_bvh_traversed_instances);
- }
- if (flag & PASSMASK(BVH_INTERSECTIONS)) {
- kernel_write_pass_float(buffer + kernel_data.film.pass_bvh_intersections,
- L->debug_data.num_bvh_intersections);
- }
- if (flag & PASSMASK(RAY_BOUNCES)) {
- kernel_write_pass_float(buffer + kernel_data.film.pass_ray_bounces,
- L->debug_data.num_ray_bounces);
- }
-}
-#endif /* __KERNEL_DEBUG__ */
-
#ifdef __KERNEL_CPU__
# define WRITE_ID_SLOT(buffer, depth, id, matte_weight, name) \
kernel_write_id_pass_cpu(buffer, depth * 2, id, matte_weight, kg->coverage_##name)
@@ -389,10 +364,6 @@ ccl_device_inline void kernel_write_result(KernelGlobals *kg,
}
#endif /* __DENOISING_FEATURES__ */
-#ifdef __KERNEL_DEBUG__
- kernel_write_debug_passes(kg, buffer, L);
-#endif
-
/* Adaptive Sampling. Fill the additional buffer with the odd samples and calculate our stopping
criteria. This is the heuristic from "A hierarchical automatic stopping condition for Monte
Carlo global illumination" except that here it is applied per pixel and not in hierarchical
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h
index dd2390808ea..3430543bc8e 100644
--- a/intern/cycles/kernel/kernel_path.h
+++ b/intern/cycles/kernel/kernel_path.h
@@ -70,15 +70,6 @@ ccl_device_forceinline bool kernel_path_scene_intersect(KernelGlobals *kg,
bool hit = scene_intersect(kg, ray, visibility, isect);
-#ifdef __KERNEL_DEBUG__
- if (state->flag & PATH_RAY_CAMERA) {
- L->debug_data.num_bvh_traversed_nodes += isect->num_traversed_nodes;
- L->debug_data.num_bvh_traversed_instances += isect->num_traversed_instances;
- L->debug_data.num_bvh_intersections += isect->num_intersections;
- }
- L->debug_data.num_ray_bounces++;
-#endif /* __KERNEL_DEBUG__ */
-
return hit;
}
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index d224db91edc..f9ea3a2d0a8 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -182,9 +182,8 @@ CCL_NAMESPACE_BEGIN
# undef __SHADER_RAYTRACE__
#endif
-/* Features that enable others */
-#ifdef WITH_CYCLES_DEBUG
-# define __KERNEL_DEBUG__
+#ifdef WITH_CYCLES_DEBUG_NAN
+# define __KERNEL_DEBUG_NAN__
#endif
#if defined(__SUBSURFACE__) || defined(__SHADER_RAYTRACE__)
@@ -356,12 +355,6 @@ typedef enum PassType {
PASS_MATERIAL_ID,
PASS_MOTION,
PASS_MOTION_WEIGHT,
-#ifdef __KERNEL_DEBUG__
- PASS_BVH_TRAVERSED_NODES,
- PASS_BVH_TRAVERSED_INSTANCES,
- PASS_BVH_INTERSECTIONS,
- PASS_RAY_BOUNCES,
-#endif
PASS_RENDER_TIME,
PASS_CRYPTOMATTE,
PASS_AOV_COLOR,
@@ -465,18 +458,6 @@ typedef enum DenoiseFlag {
DENOISING_CLEAN_ALL_PASSES = (1 << 6) - 1,
} DenoiseFlag;
-#ifdef __KERNEL_DEBUG__
-/* NOTE: This is a runtime-only struct, alignment is not
- * really important here.
- */
-typedef struct DebugData {
- int num_bvh_traversed_nodes;
- int num_bvh_traversed_instances;
- int num_bvh_intersections;
- int num_ray_bounces;
-} DebugData;
-#endif
-
typedef ccl_addr_space struct PathRadianceState {
#ifdef __PASSES__
float3 diffuse;
@@ -552,10 +533,6 @@ typedef ccl_addr_space struct PathRadiance {
float3 denoising_albedo;
float denoising_depth;
#endif /* __DENOISING_FEATURES__ */
-
-#ifdef __KERNEL_DEBUG__
- DebugData debug_data;
-#endif /* __KERNEL_DEBUG__ */
} PathRadiance;
typedef struct BsdfEval {
@@ -671,12 +648,6 @@ typedef struct Intersection {
int prim;
int object;
int type;
-
-#ifdef __KERNEL_DEBUG__
- int num_traversed_nodes;
- int num_traversed_instances;
- int num_intersections;
-#endif
} Intersection;
/* Primitives */
@@ -1265,13 +1236,6 @@ typedef struct KernelFilm {
int pass_bake_differential;
int pad;
-#ifdef __KERNEL_DEBUG__
- int pass_bvh_traversed_nodes;
- int pass_bvh_traversed_instances;
- int pass_bvh_intersections;
- int pass_ray_bounces;
-#endif
-
/* viewport rendering options */
int display_pass_stride;
int display_pass_components;
diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp
index 0948b20628f..fcfad58995e 100644
--- a/intern/cycles/render/buffers.cpp
+++ b/intern/cycles/render/buffers.cpp
@@ -322,15 +322,6 @@ bool RenderBuffers::get_pass_rect(
pixels[0] = saturate(f * scale_exposure);
}
}
-#ifdef WITH_CYCLES_DEBUG
- else if (type == PASS_BVH_TRAVERSED_NODES || type == PASS_BVH_TRAVERSED_INSTANCES ||
- type == PASS_BVH_INTERSECTIONS || type == PASS_RAY_BOUNCES) {
- for (int i = 0; i < size; i++, in += pass_stride, pixels++) {
- float f = *in;
- pixels[0] = f * scale;
- }
- }
-#endif
else {
for (int i = 0; i < size; i++, in += pass_stride, pixels++) {
float f = *in;
diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp
index c4ff89fc838..5df396394c4 100644
--- a/intern/cycles/render/film.cpp
+++ b/intern/cycles/render/film.cpp
@@ -51,12 +51,6 @@ static NodeEnum *get_pass_type_enum()
pass_type_enum.insert("material_id", PASS_MATERIAL_ID);
pass_type_enum.insert("motion", PASS_MOTION);
pass_type_enum.insert("motion_weight", PASS_MOTION_WEIGHT);
-#ifdef __KERNEL_DEBUG__
- pass_type_enum.insert("traversed_nodes", PASS_BVH_TRAVERSED_NODES);
- pass_type_enum.insert("traverse_instances", PASS_BVH_TRAVERSED_INSTANCES);
- pass_type_enum.insert("bvh_intersections", PASS_BVH_INTERSECTIONS);
- pass_type_enum.insert("ray_bounces", PASS_RAY_BOUNCES);
-#endif
pass_type_enum.insert("render_time", PASS_RENDER_TIME);
pass_type_enum.insert("cryptomatte", PASS_CRYPTOMATTE);
pass_type_enum.insert("aov_color", PASS_AOV_COLOR);
@@ -200,15 +194,6 @@ void Pass::add(PassType type, vector<Pass> &passes, const char *name)
*/
pass.components = 0;
break;
-#ifdef WITH_CYCLES_DEBUG
- case PASS_BVH_TRAVERSED_NODES:
- case PASS_BVH_TRAVERSED_INSTANCES:
- case PASS_BVH_INTERSECTIONS:
- case PASS_RAY_BOUNCES:
- pass.components = 1;
- pass.exposure = false;
- break;
-#endif
case PASS_RENDER_TIME:
/* This pass is handled entirely on the host side. */
pass.components = 0;
@@ -570,20 +555,6 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
kfilm->pass_bake_differential = kfilm->pass_stride;
break;
-#ifdef WITH_CYCLES_DEBUG
- case PASS_BVH_TRAVERSED_NODES:
- kfilm->pass_bvh_traversed_nodes = kfilm->pass_stride;
- break;
- case PASS_BVH_TRAVERSED_INSTANCES:
- kfilm->pass_bvh_traversed_instances = kfilm->pass_stride;
- break;
- case PASS_BVH_INTERSECTIONS:
- kfilm->pass_bvh_intersections = kfilm->pass_stride;
- break;
- case PASS_RAY_BOUNCES:
- kfilm->pass_ray_bounces = kfilm->pass_stride;
- break;
-#endif
case PASS_RENDER_TIME:
break;
case PASS_CRYPTOMATTE: