diff options
-rw-r--r-- | intern/cycles/render/session.cpp | 21 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_cycles.c | 3 |
2 files changed, 17 insertions, 7 deletions
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp index 8c36d34aeea..1a94d3e9db7 100644 --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -61,8 +61,10 @@ Session::Session(const SessionParams ¶ms_) TaskScheduler::init(params.threads); + /* Create CPU/GPU devices. */ device = Device::create(params.device, stats, profiler, params.background); + /* Create buffers for interactive rendering. */ if (params.background && !params.write_render_cb) { buffers = NULL; display = NULL; @@ -72,6 +74,9 @@ Session::Session(const SessionParams ¶ms_) display = new DisplayBuffer(device, params.display_buffer_linear); } + /* Validate denoising parameters. */ + set_denoising(params.denoising); + session_thread = NULL; scene = NULL; @@ -944,17 +949,21 @@ void Session::set_pause(bool pause_) void Session::set_denoising(const DenoiseParams &denoising) { - const bool need_denoise = denoising.need_denoising_task(); - - if (need_denoise && !(params.device.denoisers & denoising.type)) { - progress.set_error("Denoiser type not supported by compute device"); - return; - } + bool need_denoise = denoising.need_denoising_task(); /* Lock buffers so no denoising operation is triggered while the settings are changed here. */ thread_scoped_lock buffers_lock(buffers_mutex); params.denoising = denoising; + if (!(params.device.denoisers & denoising.type)) { + if (need_denoise) { + progress.set_error("Denoiser type not supported by compute device"); + } + + params.denoising.use = false; + need_denoise = false; + } + // TODO(pmours): Query the required overlap value for denoising from the device? tile_manager.slice_overlap = need_denoise && !params.background ? 64 : 0; diff --git a/source/blender/blenloader/intern/versioning_cycles.c b/source/blender/blenloader/intern/versioning_cycles.c index 72ee4c5ec4d..46faddf6e5a 100644 --- a/source/blender/blenloader/intern/versioning_cycles.c +++ b/source/blender/blenloader/intern/versioning_cycles.c @@ -1568,6 +1568,7 @@ void do_versions_after_linking_cycles(Main *bmain) } if (cscene) { + const int DENOISER_AUTO = 0; const int DENOISER_NLM = 1; const int DENOISER_OPTIX = 2; @@ -1578,7 +1579,7 @@ void do_versions_after_linking_cycles(Main *bmain) /* Migrate Optix denoiser to new settings. */ if (cycles_property_int(cscene, "preview_denoising", 0)) { cycles_property_boolean_set(cscene, "use_preview_denoising", true); - cycles_property_boolean_set(cscene, "preview_denoiser", DENOISER_OPTIX); + cycles_property_int_set(cscene, "preview_denoiser", DENOISER_AUTO); } } |