diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2017-05-19 04:27:38 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2017-05-19 04:29:18 +0300 |
commit | a21277b99680e02fcc09ea47026f063b1363fe40 (patch) | |
tree | 68d31ac2a58552e8dbe5d4addcca22679e6c460a /intern/cycles | |
parent | ffd83a34ab53f40a2ff0a67f893e120e94a04b25 (diff) |
Fix T51555: Cycles tile count is incorrect when denoising is enabled
Now rendered and denoised tiles are counted and displayed separately.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/render/session.cpp | 10 | ||||
-rw-r--r-- | intern/cycles/util/util_progress.h | 29 |
2 files changed, 28 insertions, 11 deletions
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp index 3eaf34c847f..3f080407b1f 100644 --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -479,7 +479,7 @@ void Session::release_tile(RenderTile& rtile) { thread_scoped_lock tile_lock(tile_mutex); - progress.add_finished_tile(); + progress.add_finished_tile(rtile.task == RenderTile::DENOISE); bool delete_tile; @@ -912,7 +912,7 @@ void Session::update_status_time(bool show_pause, bool show_done) int progressive_sample = tile_manager.state.sample; int num_samples = tile_manager.get_num_effective_samples(); - int tile = progress.get_finished_tiles(); + int tile = progress.get_rendered_tiles(); int num_tiles = tile_manager.state.num_tiles; /* update status */ @@ -920,11 +920,12 @@ void Session::update_status_time(bool show_pause, bool show_done) if(!params.progressive) { const bool is_cpu = params.device.type == DEVICE_CPU; + const bool rendering_finished = (tile == num_tiles); const bool is_last_tile = (tile + 1) == num_tiles; substatus = string_printf("Path Tracing Tile %d/%d", tile, num_tiles); - if(device->show_samples() || (is_cpu && is_last_tile)) { + if(!rendering_finished && (device->show_samples() || (is_cpu && is_last_tile))) { /* Some devices automatically support showing the sample number: * - CUDADevice * - OpenCLDevice when using the megakernel (the split kernel renders multiple @@ -936,6 +937,9 @@ void Session::update_status_time(bool show_pause, bool show_done) */ substatus += string_printf(", Sample %d/%d", progress.get_current_sample(), num_samples); } + if(params.use_denoising) { + substatus += string_printf(", Denoised %d tiles", progress.get_denoised_tiles()); + } } else if(tile_manager.num_samples == INT_MAX) substatus = string_printf("Path Tracing Sample %d", progressive_sample+1); diff --git a/intern/cycles/util/util_progress.h b/intern/cycles/util/util_progress.h index 39c1eed04e7..bc672669e1f 100644 --- a/intern/cycles/util/util_progress.h +++ b/intern/cycles/util/util_progress.h @@ -37,7 +37,8 @@ public: pixel_samples = 0; total_pixel_samples = 0; current_tile_sample = 0; - finished_tiles = 0; + rendered_tiles = 0; + denoised_tiles = 0; start_time = time_dt(); render_start_time = time_dt(); status = "Initializing"; @@ -75,7 +76,8 @@ public: pixel_samples = 0; total_pixel_samples = 0; current_tile_sample = 0; - finished_tiles = 0; + rendered_tiles = 0; + denoised_tiles = 0; start_time = time_dt(); render_start_time = time_dt(); status = "Initializing"; @@ -177,7 +179,8 @@ public: pixel_samples = 0; current_tile_sample = 0; - finished_tiles = 0; + rendered_tiles = 0; + denoised_tiles = 0; } void set_total_pixel_samples(uint64_t total_pixel_samples_) @@ -209,11 +212,16 @@ public: set_update(); } - void add_finished_tile() + void add_finished_tile(bool denoised) { thread_scoped_lock lock(progress_mutex); - finished_tiles++; + if(denoised) { + denoised_tiles++; + } + else { + rendered_tiles++; + } } int get_current_sample() @@ -223,9 +231,14 @@ public: return current_tile_sample; } - int get_finished_tiles() + int get_rendered_tiles() + { + return rendered_tiles; + } + + int get_denoised_tiles() { - return finished_tiles; + return denoised_tiles; } /* status messages */ @@ -318,7 +331,7 @@ protected: int current_tile_sample; /* Stores the number of tiles that's already finished. * Used to determine whether all but the last tile are finished rendering, in which case the current_tile_sample is displayed. */ - int finished_tiles; + int rendered_tiles, denoised_tiles; double start_time, render_start_time; |