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
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2021-11-16 22:44:31 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-11-16 22:49:32 +0300
commitcfd0e96e47ed34888077b989854ba5a557bac43b (patch)
tree0afe6d7a14af81482266ba581336143c61f57fc6 /intern/cycles/integrator
parent7293c1b3578e015a00e8b1e282baa62f51c5b4c4 (diff)
Fix T93125: Cycles wrong remaining render time with high number of samples
Avoid integer overflow.
Diffstat (limited to 'intern/cycles/integrator')
-rw-r--r--intern/cycles/integrator/path_trace.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/intern/cycles/integrator/path_trace.cpp b/intern/cycles/integrator/path_trace.cpp
index f3a08b1659c..92bf8e69d19 100644
--- a/intern/cycles/integrator/path_trace.cpp
+++ b/intern/cycles/integrator/path_trace.cpp
@@ -847,7 +847,8 @@ void PathTrace::progress_update_if_needed(const RenderWork &render_work)
{
if (progress_ != nullptr) {
const int2 tile_size = get_render_tile_size();
- const int num_samples_added = tile_size.x * tile_size.y * render_work.path_trace.num_samples;
+ const uint64_t num_samples_added = uint64_t(tile_size.x) * tile_size.y *
+ render_work.path_trace.num_samples;
const int current_sample = render_work.path_trace.start_sample +
render_work.path_trace.num_samples;
progress_->add_samples(num_samples_added, current_sample);