Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2021-09-22 19:00:39 +0300
committerSergey Sharybin <sergey@blender.org>2021-09-22 19:09:06 +0300
commit4068b6b5a7112647f4efe4f7df0ee3c6399a1b2d (patch)
tree71c74b543605c90d2c119d6df2e952c2fcf7acdc /intern
parent5033310e8aca2cbbb5d55f306d8b98663469867f (diff)
Fix T91598: Decreasing sample count causes viewport to reset
Differential Revision: https://developer.blender.org/D12601
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/render/session.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
index 0539e02a8d5..823c34ed519 100644
--- a/intern/cycles/render/session.cpp
+++ b/intern/cycles/render/session.cpp
@@ -261,6 +261,7 @@ RenderWork Session::run_update_for_next_iteration()
bool have_tiles = true;
bool switched_to_new_tile = false;
+ const bool did_reset = delayed_reset_.do_reset;
if (delayed_reset_.do_reset) {
thread_scoped_lock buffers_lock(buffers_mutex_);
do_delayed_reset();
@@ -272,8 +273,12 @@ RenderWork Session::run_update_for_next_iteration()
/* Update number of samples in the integrator.
* Ideally this would need to happen once in `Session::set_samples()`, but the issue there is
- * the initial configuration when Session is created where the `set_samples()` is not used. */
- scene->integrator->set_aa_samples(params.samples);
+ * the initial configuration when Session is created where the `set_samples()` is not used.
+ *
+ * NOTE: Unless reset was requested only allow increasing number of samples. */
+ if (did_reset || scene->integrator->get_aa_samples() < params.samples) {
+ scene->integrator->set_aa_samples(params.samples);
+ }
/* Update denoiser settings. */
{