Cycles: abort rendering when --cycles-device not found

Rather than just printing a message and falling back to the CPU. For render
farms it's better to avoid a potentially slow render on the CPU if the intent
was to render on the GPU.

Ref T82193, D9086
This commit is contained in:
2020-10-28 19:55:41 +01:00
parent 09be2a8358
commit f75b09e7e6
8 changed files with 129 additions and 27 deletions

View File

@@ -61,22 +61,6 @@ Session::Session(const SessionParams &params_)
TaskScheduler::init(params.threads);
/* Create CPU/GPU devices. */
device = Device::create(params.device, stats, profiler, params.background);
/* Create buffers for interactive rendering. */
if (params.background && !params.write_render_cb) {
buffers = NULL;
display = NULL;
}
else {
buffers = new RenderBuffers(device);
display = new DisplayBuffer(device, params.display_buffer_linear);
}
/* Validate denoising parameters. */
set_denoising(params.denoising);
session_thread = NULL;
scene = NULL;
@@ -90,6 +74,26 @@ Session::Session(const SessionParams &params_)
gpu_draw_ready = false;
gpu_need_display_buffer_update = false;
pause = false;
buffers = NULL;
display = NULL;
/* Validate denoising parameters. */
set_denoising(params.denoising);
/* Create CPU/GPU devices. */
device = Device::create(params.device, stats, profiler, params.background);
if (!device->error_message().empty()) {
progress.set_error(device->error_message());
return;
}
/* Create buffers for interactive rendering. */
if (!(params.background && !params.write_render_cb)) {
buffers = new RenderBuffers(device);
display = new DisplayBuffer(device, params.display_buffer_linear);
}
}
Session::~Session()
@@ -110,7 +114,7 @@ Session::~Session()
wait();
}
if (params.write_render_cb) {
if (buffers && params.write_render_cb) {
/* Copy to display buffer and write out image if requested */
delete display;