From cfd0e96e47ed34888077b989854ba5a557bac43b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Nov 2021 20:44:31 +0100 Subject: Fix T93125: Cycles wrong remaining render time with high number of samples Avoid integer overflow. --- intern/cycles/blender/session.cpp | 8 ++++---- intern/cycles/blender/session.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'intern/cycles/blender') diff --git a/intern/cycles/blender/session.cpp b/intern/cycles/blender/session.cpp index b7fd862bffd..c786b29d442 100644 --- a/intern/cycles/blender/session.cpp +++ b/intern/cycles/blender/session.cpp @@ -129,7 +129,7 @@ void BlenderSession::create_session() /* reset status/progress */ last_status = ""; last_error = ""; - last_progress = -1.0f; + last_progress = -1.0; start_resize_time = 0.0; /* create session */ @@ -854,7 +854,7 @@ void BlenderSession::get_status(string &status, string &substatus) session->progress.get_status(status, substatus); } -void BlenderSession::get_progress(float &progress, double &total_time, double &render_time) +void BlenderSession::get_progress(double &progress, double &total_time, double &render_time) { session->progress.get_time(total_time, render_time); progress = session->progress.get_progress(); @@ -862,7 +862,7 @@ void BlenderSession::get_progress(float &progress, double &total_time, double &r void BlenderSession::update_bake_progress() { - float progress = session->progress.get_progress(); + double progress = session->progress.get_progress(); if (progress != last_progress) { b_engine.update_progress(progress); @@ -874,7 +874,7 @@ void BlenderSession::update_status_progress() { string timestatus, status, substatus; string scene_status = ""; - float progress; + double progress; double total_time, remaining_time = 0, render_time; float mem_used = (float)session->stats.mem_used / 1024.0f / 1024.0f; float mem_peak = (float)session->stats.mem_peak / 1024.0f / 1024.0f; diff --git a/intern/cycles/blender/session.h b/intern/cycles/blender/session.h index fa24b5f7467..f837e97c17c 100644 --- a/intern/cycles/blender/session.h +++ b/intern/cycles/blender/session.h @@ -82,7 +82,7 @@ class BlenderSession { void tag_redraw(); void tag_update(); void get_status(string &status, string &substatus); - void get_progress(float &progress, double &total_time, double &render_time); + void get_progress(double &progress, double &total_time, double &render_time); void test_cancel(); void update_status_progress(); void update_bake_progress(); @@ -108,7 +108,7 @@ class BlenderSession { string last_status; string last_error; - float last_progress; + double last_progress; double last_status_time; int width, height; -- cgit v1.2.3