diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-06-25 16:14:30 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-06-25 16:39:10 +0300 |
commit | 79c2581bfaf0612f44c44cd09533fc8d231a2d49 (patch) | |
tree | 4f1244d6016e8b6933236a1682ac8ad42aa65955 /intern/cycles/render/session.cpp | |
parent | 2b9ac1de491142508212471fb8e1d2cbdd655914 (diff) |
Fix T78238: issue loading existing .blend files with Optix viewport denoiser
Also add additional validation to ensure the denoiser is supported before
trying to use it.
Diffstat (limited to 'intern/cycles/render/session.cpp')
-rw-r--r-- | intern/cycles/render/session.cpp | 21 |
1 files changed, 15 insertions, 6 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; |