diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-11-16 22:44:31 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-11-16 22:49:32 +0300 |
commit | cfd0e96e47ed34888077b989854ba5a557bac43b (patch) | |
tree | 0afe6d7a14af81482266ba581336143c61f57fc6 /intern/cycles/blender | |
parent | 7293c1b3578e015a00e8b1e282baa62f51c5b4c4 (diff) |
Fix T93125: Cycles wrong remaining render time with high number of samples
Avoid integer overflow.
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/session.cpp | 8 | ||||
-rw-r--r-- | intern/cycles/blender/session.h | 4 |
2 files changed, 6 insertions, 6 deletions
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; |