diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-10-04 17:00:26 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-10-04 17:00:26 +0400 |
commit | 27d660ad20a57a8f688890a04d2eb629e39a3f19 (patch) | |
tree | 218c119ef8908566cb411fce385cb51a72b7b85f /source/blender/makesrna/intern | |
parent | 8ac3c3d3ee229ba5b2df90f2276db1049bd104cc (diff) |
Cycles: Add support for debug passes
Currently only summed number of traversal steps and intersections used by the
camera ray intersection pass is implemented, but in the future we will support
more debug passes which would help checking what things makes the scene slow.
Example of such extra passes could be number of bounces, time spent on the
shader tree evaluation and so.
Implementation from the Cycles side is pretty much straightforward, could only
mention here that it's a build-time option disabled by default.
From the blender side it's implemented as a PASS_DEBUG with several subtypes
possible. This way we don't need to create an extra DNA pass type for each of
the debug passes, saving us a bits.
Reviewers: campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D813
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/CMakeLists.txt | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/SConscript | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_render.c | 12 |
3 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index d62a2e2c76e..c5f62439b9e 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -155,6 +155,9 @@ set(INC_SYS if(WITH_CYCLES) add_definitions(-DWITH_CYCLES) + if(WITH_CYCLES_DEBUG) + add_definitions(-DWITH_CYCLES_DEBUG) + endif() endif() if(WITH_PYTHON) diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 179a332336e..9fda79feb74 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -140,6 +140,8 @@ if env['WITH_BF_COLLADA']: if env['WITH_BF_CYCLES']: defs.append('WITH_CYCLES') + if env['WITH_BF_CYCLES_DEBUG']: + defs.append('WITH_CYCLES_DEBUG') if env['WITH_BF_FREESTYLE']: defs.append('WITH_FREESTYLE') diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 284377d34f9..c5750f56d28 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -71,6 +71,9 @@ EnumPropertyItem render_pass_type_items[] = { {SCE_PASS_SUBSURFACE_DIRECT, "SUBSURFACE_DIRECT", 0, "Subsurface Direct", ""}, {SCE_PASS_SUBSURFACE_INDIRECT, "SUBSURFACE_INDIRECT", 0, "Subsurface Indirect", ""}, {SCE_PASS_SUBSURFACE_COLOR, "SUBSURFACE_COLOR", 0, "Subsurface Color", ""}, +#ifdef WITH_CYCLES_DEBUG + {SCE_PASS_DEBUG, "DEBUG", 0, "Pass used for render engine debugging", ""}, +#endif {0, NULL, 0, NULL, NULL} }; @@ -683,6 +686,10 @@ static void rna_def_render_pass(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; + static EnumPropertyItem render_pass_debug_type_items[] = { + {RENDER_PASS_DEBUG_BVH_TRAVERSAL_STEPS, "BVH_TRAVERSAL_STEPS", 0, "BVH Traversal Steps", ""}, + }; + srna = RNA_def_struct(brna, "RenderPass", NULL); RNA_def_struct_ui_text(srna, "Render Pass", ""); @@ -712,6 +719,11 @@ static void rna_def_render_pass(BlenderRNA *brna) RNA_def_property_dynamic_array_funcs(prop, "rna_RenderPass_rect_get_length"); RNA_def_property_float_funcs(prop, "rna_RenderPass_rect_get", "rna_RenderPass_rect_set", NULL); + prop = RNA_def_property(srna, "debug_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "debug_type"); + RNA_def_property_enum_items(prop, render_pass_debug_type_items); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_define_verify_sdna(1); } |