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 /intern/cycles/render | |
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 'intern/cycles/render')
-rw-r--r-- | intern/cycles/render/buffers.cpp | 8 | ||||
-rw-r--r-- | intern/cycles/render/film.cpp | 13 |
2 files changed, 21 insertions, 0 deletions
diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp index fc65922fc87..756e16b38b5 100644 --- a/intern/cycles/render/buffers.cpp +++ b/intern/cycles/render/buffers.cpp @@ -190,6 +190,14 @@ bool RenderBuffers::get_pass_rect(PassType type, float exposure, int sample, int pixels[0] = clamp(f*scale_exposure, 0.0f, 1.0f); } } +#ifdef WITH_CYCLES_DEBUG + else if(type == PASS_BVH_TRAVERSAL_STEPS) { + for(int i = 0; i < size; i++, in += pass_stride, pixels++) { + float f = *in; + pixels[0] = f; + } + } +#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 09973e8bc86..19f959d4ea1 100644 --- a/intern/cycles/render/film.cpp +++ b/intern/cycles/render/film.cpp @@ -146,6 +146,12 @@ void Pass::add(PassType type, vector<Pass>& passes) case PASS_LIGHT: /* ignores */ break; +#ifdef WITH_CYCLES_DEBUG + case PASS_BVH_TRAVERSAL_STEPS: + pass.components = 1; + pass.exposure = false; + break; +#endif } passes.push_back(pass); @@ -388,6 +394,13 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene) case PASS_LIGHT: kfilm->use_light_pass = 1; break; + +#ifdef WITH_CYCLES_DEBUG + case PASS_BVH_TRAVERSAL_STEPS: + kfilm->pass_bvh_traversal_steps = kfilm->pass_stride; + break; +#endif + case PASS_NONE: break; } |