[Bf-blender-cvs] [e76c945277f] cycles-x: Cycles X: Remove BVH and bounces debug passes

Sergey Sharybin noreply at git.blender.org
Thu May 27 16:35:17 CEST 2021


Commit: e76c945277fd65f71758e840691e66843b8aa2a9
Author: Sergey Sharybin
Date:   Thu May 27 15:13:01 2021 +0200
Branches: cycles-x
https://developer.blender.org/rBe76c945277fd65f71758e840691e66843b8aa2a9

Cycles X: Remove BVH and bounces debug passes

Those are only available when Cycles is compiled with special flag, and
do not work on all configurations. For the simplicity removing them.
If we need something like this, better to implement it in a way that is
available for official builds as well.

===================================================================

M	intern/cycles/blender/addon/ui.py
M	intern/cycles/blender/blender_python.cpp
M	intern/cycles/blender/blender_sync.cpp
M	intern/cycles/device/cuda/device_impl.cpp
M	intern/cycles/device/opencl/device_impl.cpp
M	intern/cycles/device/optix/device_impl.cpp
M	intern/cycles/kernel/CMakeLists.txt
M	intern/cycles/kernel/bvh/bvh_traversal.h
M	intern/cycles/kernel/bvh/bvh_types.h
M	intern/cycles/kernel/kernel_passes.h
M	intern/cycles/kernel/kernel_path.h
M	intern/cycles/kernel/kernel_types.h
M	intern/cycles/render/film.cpp
M	intern/cycles/render/pass.cpp
M	intern/cycles/render/pass_accessor.cpp
M	source/blender/makesrna/intern/rna_render.c

===================================================================

diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 7a96a9c7671..1f68e24c357 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -795,29 +795,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"
@@ -2143,7 +2120,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 e403fa66eda..bc482de52d1 100644
--- a/intern/cycles/blender/blender_python.cpp
+++ b/intern/cycles/blender/blender_python.cpp
@@ -1102,14 +1102,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_EMBREE
   PyModule_AddObject(mod, "with_embree", Py_True);
   Py_INCREF(Py_True);
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp
index 744bf6a70d0..ac41fa56637 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -530,13 +530,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("Noisy Image", PASS_DENOISING_COLOR);
   MAP_PASS("Denoising Normal", PASS_DENOISING_NORMAL);
   MAP_PASS("Denoising Albedo", PASS_DENOISING_ALBEDO);
@@ -590,24 +583,6 @@ void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_v
     Pass::add(PASS_DENOISING_COLOR, passes, "Noisy Image");
   }
 
-#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_impl.cpp b/intern/cycles/device/cuda/device_impl.cpp
index 18ba51a2d03..951220395b6 100644
--- a/intern/cycles/device/cuda/device_impl.cpp
+++ b/intern/cycles/device/cuda/device_impl.cpp
@@ -241,9 +241,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
 
 #  ifdef WITH_NANOVDB
   cflags += " -DWITH_NANOVDB";
diff --git a/intern/cycles/device/opencl/device_impl.cpp b/intern/cycles/device/opencl/device_impl.cpp
index 0dd4094f9cc..da0d1abf8dc 100644
--- a/intern/cycles/device/opencl/device_impl.cpp
+++ b/intern/cycles/device/opencl/device_impl.cpp
@@ -1461,10 +1461,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/device/optix/device_impl.cpp b/intern/cycles/device/optix/device_impl.cpp
index 1483e2715cd..c759bd4f160 100644
--- a/intern/cycles/device/optix/device_impl.cpp
+++ b/intern/cycles/device/optix/device_impl.cpp
@@ -217,6 +217,8 @@ bool OptiXDevice::load_kernels(const DeviceRequestedFeatures &requested_features
 
   OptixModuleCompileOptions module_options = {};
   module_options.maxRegisterCount = 0; /* Do not set an explicit register limit. */
+
+  /* TODO(sergey): Make it configurable via `DebugFlags` instead of compile-time. */
 #  ifdef WITH_CYCLES_DEBUG
   module_options.optLevel = OPTIX_COMPILE_OPTIMIZATION_LEVEL_0;
   module_options.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_FULL;
@@ -422,6 +424,8 @@ bool OptiXDevice::load_kernels(const DeviceRequestedFeatures &requested_features
 
   OptixPipelineLinkOptions link_options = {};
   link_options.maxTraceDepth = 1;
+
+  /* TODO(sergey): Make it configurable via `DebugFlags` instead of compile-time. */
 #  ifdef WITH_CYCLES_DEBUG
   link_options.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_FULL;
 #  else
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index 4137163e570..9a46e4bff19 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -371,10 +371,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
@@ -483,11 +479,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 4de5185a002..a26d8c514f3 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)(const 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)(const 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)(const 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, isect->t, visibility, object, prim_addr)) {
@@ -152,7 +148,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(const 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, isect->t, ray->time, visibility, object, prim_addr)) {
@@ -170,7 +165,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(const 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(kg,
@@ -209,8 +203,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(const 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 106cbfcdab1..6039e707fc3 100644
--- a/intern/cycles/kernel/bvh/bvh_types.h
+++ b/intern/cycles/kernel/bvh/bvh_types.h
@@ -41,31 +41,4 @@ CCL_NAMESPACE_BEGIN
 
 #define BVH_FEATURE(f) (((BVH_FUNCTION_FEA

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list