Fix T74504: Cycles wrong progress bar with CPU adaptive sampling

This commit is contained in:
Brecht Van Lommel 2020-03-06 23:13:03 +01:00
parent b31b44c223
commit dcdcc23488
Notes: blender-bot 2023-02-14 05:53:38 +01:00
Referenced by issue #74537, Adaptive sampling + AO color node crashes (when shader rays exceed 32K).
Referenced by issue #74504, Cycles new adaptive sampling causes wrong progress bar for the render process
1 changed files with 4 additions and 2 deletions

View 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();