diff options
author | Sergey Sharybin <sergey@blender.org> | 2021-09-23 18:20:59 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2021-09-28 17:58:27 +0300 |
commit | 728ae33f3720894a59009e28d33ae82f77c380b3 (patch) | |
tree | e504c26dd92fccf3f0ba4021aceebb65fb9b028b /intern/cycles/blender/blender_session.cpp | |
parent | 52a702468a59f1945ecfcf6dde6bccf648a27d36 (diff) |
Cycles: Improve handling of tile file error
Expose them to the interface, and stop rendering as soon as possible.
Differential Revision: https://developer.blender.org/D12617
Diffstat (limited to 'intern/cycles/blender/blender_session.cpp')
-rw-r--r-- | intern/cycles/blender/blender_session.cpp | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index 8d6db30f1a8..88edc7eafe7 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -589,6 +589,12 @@ void BlenderSession::render_frame_finish() for (string_view filename : full_buffer_files_) { session->process_full_buffer_from_disk(filename); + if (check_and_report_session_error()) { + break; + } + } + + for (string_view filename : full_buffer_files_) { path_remove(filename); } @@ -1036,20 +1042,27 @@ void BlenderSession::update_status_progress() last_progress = progress; } - if (session->progress.get_error()) { - string error = session->progress.get_error_message(); - if (error != last_error) { - /* TODO(sergey): Currently C++ RNA API doesn't let us to - * use mnemonic name for the variable. Would be nice to - * have this figured out. - * - * For until then, 1 << 5 means RPT_ERROR. - */ - b_engine.report(1 << 5, error.c_str()); - b_engine.error_set(error.c_str()); - last_error = error; - } + check_and_report_session_error(); +} + +bool BlenderSession::check_and_report_session_error() +{ + if (!session->progress.get_error()) { + return false; } + + const string error = session->progress.get_error_message(); + if (error != last_error) { + /* TODO(sergey): Currently C++ RNA API doesn't let us to use mnemonic name for the variable. + * Would be nice to have this figured out. + * + * For until then, 1 << 5 means RPT_ERROR. */ + b_engine.report(1 << 5, error.c_str()); + b_engine.error_set(error.c_str()); + last_error = error; + } + + return true; } void BlenderSession::tag_update() |