diff options
Diffstat (limited to 'intern/cycles/render')
-rw-r--r-- | intern/cycles/render/session.cpp | 21 | ||||
-rw-r--r-- | intern/cycles/render/session.h | 12 |
2 files changed, 24 insertions, 9 deletions
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp index acf9ca68889..ae0a2cf863a 100644 --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -908,9 +908,6 @@ void Session::set_samples(int samples) params.samples = samples; tile_manager.set_samples(samples); - { - thread_scoped_lock pause_lock(pause_mutex); - } pause_cond.notify_all(); } } @@ -946,6 +943,15 @@ void Session::set_denoising(bool denoising, bool optix_denoising) tile_manager.schedule_denoising = denoising && !buffers; } +void Session::set_denoising_start_sample(int sample) +{ + if (sample != params.denoising_start_sample) { + params.denoising_start_sample = sample; + + pause_cond.notify_all(); + } +} + void Session::wait() { if (session_thread) { @@ -1110,8 +1116,8 @@ void Session::denoise() return; } - /* It can happen that denoising was already enabled, but the scene still needs an update. */ - if (scene->film->need_update || !scene->film->denoising_data_offset) { + /* Do not denoise viewport until the sample at which denoising should start is reached. */ + if (!params.background && tile_manager.state.sample < params.denoising_start_sample) { return; } @@ -1122,6 +1128,11 @@ void Session::denoise() return; } + /* It can happen that denoising was already enabled, but the scene still needs an update. */ + if (scene->film->need_update || !scene->film->denoising_data_offset) { + return; + } + /* Add separate denoising task. */ DeviceTask task(DeviceTask::DENOISE); diff --git a/intern/cycles/render/session.h b/intern/cycles/render/session.h index 3ef2b70879a..40ec3979afd 100644 --- a/intern/cycles/render/session.h +++ b/intern/cycles/render/session.h @@ -53,6 +53,7 @@ class SessionParams { int2 tile_size; TileOrder tile_order; int start_resolution; + int denoising_start_sample; int pixel_size; int threads; @@ -85,6 +86,7 @@ class SessionParams { samples = 1024; tile_size = make_int2(64, 64); start_resolution = INT_MAX; + denoising_start_sample = 0; pixel_size = 1; threads = 0; @@ -109,9 +111,10 @@ class SessionParams { bool modified(const SessionParams ¶ms) { return !(device == params.device && background == params.background && - progressive_refine == params.progressive_refine - /* && samples == params.samples */ - && progressive == params.progressive && experimental == params.experimental && + progressive_refine == params.progressive_refine && + /* samples == params.samples && denoising_start_sample == + params.denoising_start_sample && */ + progressive == params.progressive && experimental == params.experimental && tile_size == params.tile_size && start_resolution == params.start_resolution && pixel_size == params.pixel_size && threads == params.threads && use_profiling == params.use_profiling && @@ -152,9 +155,10 @@ class Session { bool ready_to_reset(); void reset(BufferParams ¶ms, int samples); - void set_samples(int samples); void set_pause(bool pause); + void set_samples(int samples); void set_denoising(bool denoising, bool optix_denoising); + void set_denoising_start_sample(int sample); bool update_scene(); bool load_kernels(bool lock_scene = true); |