Cycles: Report error to the blender using report API

This way when something goes wrong in Cycles (for example out of VRAM, timelimit
launching the kernel etc) we'll have a nice report in the Info space header.

Sure it'll be nice to have mention of error in the image editor's information
line, but that's for the future.

This fixes T42747: "CUDA error" appears only momentarily, then disappears
This commit is contained in:
Sergey Sharybin 2014-12-05 21:27:52 +05:00
parent bd0b9ed0c0
commit 2b4eeb79cd
Notes: blender-bot 2023-02-14 09:46:06 +01:00
Referenced by issue #42747, "CUDA error" appears only momentarily, then disappears
2 changed files with 16 additions and 0 deletions

View File

@ -92,6 +92,7 @@ void BlenderSession::create_session()
/* reset status/progress */
last_status = "";
last_error = "";
last_progress = -1.0f;
start_resize_time = 0.0;
@ -863,6 +864,20 @@ void BlenderSession::update_status_progress()
b_engine.update_progress(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());
last_error = error;
}
}
}
void BlenderSession::tag_update()

View File

@ -91,6 +91,7 @@ public:
string b_rlay_name;
string last_status;
string last_error;
float last_progress;
int width, height;