diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/addon/engine.py | 1 | ||||
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 6 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 3 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 5 | ||||
-rw-r--r-- | intern/cycles/device/device_cpu.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/device/opencl/opencl_mega.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/device/opencl/opencl_split.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 1 | ||||
-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 |
12 files changed, 37 insertions, 2 deletions
diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py index bc71a1b2fd7..1f97eff9bd0 100644 --- a/intern/cycles/blender/addon/engine.py +++ b/intern/cycles/blender/addon/engine.py @@ -234,6 +234,7 @@ def register_passes(engine, scene, srl): if srl.use_pass_environment: engine.register_pass(scene, srl, "Env", 3, "RGB", 'COLOR') crl = srl.cycles + if crl.pass_debug_render_time: engine.register_pass(scene, srl, "Debug Render Time", 1, "X", 'VALUE') if crl.pass_debug_bvh_traversed_nodes: engine.register_pass(scene, srl, "Debug BVH Traversed Nodes", 1, "X", 'VALUE') if crl.pass_debug_bvh_traversed_instances: engine.register_pass(scene, srl, "Debug BVH Traversed Instances", 1, "X", 'VALUE') if crl.pass_debug_bvh_intersections: engine.register_pass(scene, srl, "Debug BVH Intersections", 1, "X", 'VALUE') diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index e20e0b757c1..e5084138a9c 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -1189,6 +1189,12 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup): default=False, update=update_render_passes, ) + cls.pass_debug_render_time = BoolProperty( + name="Debug Render Time", + description="Render time in milliseconds per sample and pixel", + default=False, + update=update_render_passes, + ) cls.use_pass_volume_direct = BoolProperty( name="Volume Direct", description="Deliver direct volumetric scattering pass", diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index ff36e2a82d8..03ca1ab6c7f 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -541,8 +541,9 @@ class CYCLES_RENDER_PT_layer_passes(CyclesButtonsPanel, Panel): sub.active = crl.use_denoising sub.prop(crl, "denoising_store_passes", text="Denoising") + col = layout.column() + col.prop(crl, "pass_debug_render_time") if _cycles.with_cycles_debug: - col = layout.column() col.prop(crl, "pass_debug_bvh_traversed_nodes") col.prop(crl, "pass_debug_bvh_traversed_instances") col.prop(crl, "pass_debug_bvh_intersections") diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index dbc559e749e..e24ed31b926 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -520,6 +520,7 @@ PassType BlenderSync::get_pass_type(BL::RenderPass& b_pass) 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); #undef MAP_PASS return PASS_NONE; @@ -606,6 +607,10 @@ array<Pass> BlenderSync::sync_render_passes(BL::RenderLayer& b_rlay, Pass::add(PASS_RAY_BOUNCES, passes); } #endif + if(get_boolean(crp, "pass_debug_render_time")) { + b_engine.add_pass("Debug Render Time", 1, "X", b_srlay.name().c_str()); + Pass::add(PASS_RENDER_TIME, passes); + } if(get_boolean(crp, "use_pass_volume_direct")) { b_engine.add_pass("VolumeDir", 3, "RGB", b_srlay.name().c_str()); Pass::add(PASS_VOLUME_DIRECT, passes); diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index ce02a5a932e..999b9230d29 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -689,6 +689,8 @@ public: void path_trace(DeviceTask &task, RenderTile &tile, KernelGlobals *kg) { + scoped_timer timer(&tile.buffers->render_time); + float *render_buffer = (float*)tile.buffer; int start_sample = tile.start_sample; int end_sample = tile.start_sample + tile.num_samples; diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 305e5e9f1af..d8d787ba706 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -1436,6 +1436,8 @@ public: void path_trace(DeviceTask& task, RenderTile& rtile, device_vector<WorkTile>& work_tiles) { + scoped_timer timer(&rtile.buffers->render_time); + if(have_error()) return; diff --git a/intern/cycles/device/opencl/opencl_mega.cpp b/intern/cycles/device/opencl/opencl_mega.cpp index 575ab73330e..ef39cfb5f7d 100644 --- a/intern/cycles/device/opencl/opencl_mega.cpp +++ b/intern/cycles/device/opencl/opencl_mega.cpp @@ -59,6 +59,8 @@ public: void path_trace(RenderTile& rtile, int sample) { + scoped_timer timer(&rtile.buffers->render_time); + /* Cast arguments to cl types. */ cl_mem d_data = CL_MEM_PTR(const_mem_map["__data"]->device_pointer); cl_mem d_buffer = CL_MEM_PTR(rtile.buffer); diff --git a/intern/cycles/device/opencl/opencl_split.cpp b/intern/cycles/device/opencl/opencl_split.cpp index 1073cfa6bf6..2d819080674 100644 --- a/intern/cycles/device/opencl/opencl_split.cpp +++ b/intern/cycles/device/opencl/opencl_split.cpp @@ -138,6 +138,8 @@ public: while(task->acquire_tile(this, tile)) { if(tile.task == RenderTile::PATH_TRACE) { assert(tile.task == RenderTile::PATH_TRACE); + scoped_timer timer(&tile.buffers->render_time); + split_kernel->path_trace(task, tile, kgbuffer, diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index b6a9cf5f285..c4a9b3f4aa3 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -393,6 +393,7 @@ typedef enum PassType { PASS_BVH_INTERSECTIONS, PASS_RAY_BOUNCES, #endif + PASS_RENDER_TIME, PASS_CATEGORY_MAIN_END = 31, PASS_MIST = 32, 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); |