Fix T74504: Cycles wrong progress bar with CPU adaptive sampling
authorBrecht Van Lommel <brecht@blender.org>
Fri, 6 Mar 2020 22:13:03 +0000 (23:13 +0100)
committerBrecht Van Lommel <brecht@blender.org>
Fri, 6 Mar 2020 22:46:58 +0000 (23:46 +0100)
intern/cycles/device/device_cpu.cpp

index 16e9f2d43406e3f8a73e75c24c3e7417b2c42756..d11918ccbbf85b02bbe3966ad0941c19070de54e 100644 (file)
@@ -907,15 +907,17 @@ class CPUDevice : public Device {
       }
       tile.sample = sample + 1;
 
-      task.update_progress(&tile, tile.w * tile.h);
-
       if (task.adaptive_sampling.use && task.adaptive_sampling.need_filter(sample)) {
         const bool stop = adaptive_sampling_filter(kg, tile);
         if (stop) {
+          const int num_progress_samples = end_sample - sample;
           tile.sample = end_sample;
+          task.update_progress(&tile, tile.w * tile.h * num_progress_samples);
           break;
         }
       }
+
+      task.update_progress(&tile, tile.w * tile.h);
     }
     if (use_coverage) {
       coverage.finalize();