diff options
Diffstat (limited to 'intern/cycles/render')
-rw-r--r-- | intern/cycles/render/buffers.cpp | 8 | ||||
-rw-r--r-- | intern/cycles/render/buffers.h | 1 | ||||
-rw-r--r-- | intern/cycles/render/film.cpp | 6 |
3 files changed, 14 insertions, 1 deletions
diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp index ac675dc7b39..2fa297371f4 100644 --- a/intern/cycles/render/buffers.cpp +++ b/intern/cycles/render/buffers.cpp @@ -116,7 +116,7 @@ RenderTile::RenderTile() RenderBuffers::RenderBuffers(Device *device) : buffer(device, "RenderBuffers", MEM_READ_WRITE), - map_neighbor_copied(false) + map_neighbor_copied(false), render_time(0.0f) { } @@ -264,6 +264,12 @@ bool RenderBuffers::get_pass_rect(PassType type, float exposure, int sample, int } } #endif + else if(type == PASS_RENDER_TIME) { + float val = (float) (1000.0 * render_time/(params.width * params.height * sample)); + for(int i = 0; i < size; i++, pixels++) { + pixels[0] = val; + } + } else { for(int i = 0; i < size; i++, in += pass_stride, pixels++) { float f = *in; diff --git a/intern/cycles/render/buffers.h b/intern/cycles/render/buffers.h index 9fa0cdd4e27..028bfb83735 100644 --- a/intern/cycles/render/buffers.h +++ b/intern/cycles/render/buffers.h @@ -75,6 +75,7 @@ public: /* float buffer */ device_vector<float> buffer; bool map_neighbor_copied; + double render_time; explicit RenderBuffers(Device *device); ~RenderBuffers(); diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp index 82fea67f001..6c8c929c2f9 100644 --- a/intern/cycles/render/film.cpp +++ b/intern/cycles/render/film.cpp @@ -116,6 +116,10 @@ void Pass::add(PassType type, array<Pass>& passes) pass.exposure = false; break; #endif + case PASS_RENDER_TIME: + /* This pass is handled entirely on the host side. */ + pass.components = 0; + break; case PASS_DIFFUSE_COLOR: case PASS_GLOSSY_COLOR: @@ -428,6 +432,8 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene) kfilm->pass_ray_bounces = kfilm->pass_stride; break; #endif + case PASS_RENDER_TIME: + break; default: assert(false); |