forked from bartvdbraak/blender
Fix cycles standalone not writing images in background mode properly.
This commit is contained in:
parent
72308669ce
commit
976f59ab8c
@ -81,6 +81,7 @@ Session::Session(const SessionParams& params_)
|
|||||||
Session::~Session()
|
Session::~Session()
|
||||||
{
|
{
|
||||||
if(session_thread) {
|
if(session_thread) {
|
||||||
|
/* wait for session thread to end */
|
||||||
progress.set_cancel("Exiting");
|
progress.set_cancel("Exiting");
|
||||||
|
|
||||||
gpu_need_tonemap = false;
|
gpu_need_tonemap = false;
|
||||||
@ -95,13 +96,19 @@ Session::~Session()
|
|||||||
wait();
|
wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(display && !params.output_path.empty()) {
|
if(!params.output_path.empty()) {
|
||||||
|
/* tonemap and write out image if requested */
|
||||||
|
delete display;
|
||||||
|
|
||||||
|
display = new DisplayBuffer(device, false);
|
||||||
|
display->reset(device, buffers->params);
|
||||||
tonemap();
|
tonemap();
|
||||||
|
|
||||||
progress.set_status("Writing Image", params.output_path);
|
progress.set_status("Writing Image", params.output_path);
|
||||||
display->write(device, params.output_path);
|
display->write(device, params.output_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* clean up */
|
||||||
foreach(RenderBuffers *buffers, tile_buffers)
|
foreach(RenderBuffers *buffers, tile_buffers)
|
||||||
delete buffers;
|
delete buffers;
|
||||||
|
|
||||||
@ -367,7 +374,7 @@ bool Session::acquire_tile(Device *tile_device, RenderTile& rtile)
|
|||||||
|
|
||||||
/* in case of a permanent buffer, return it, otherwise we will allocate
|
/* in case of a permanent buffer, return it, otherwise we will allocate
|
||||||
* a new temporary buffer */
|
* a new temporary buffer */
|
||||||
if(!params.background) {
|
if(!(params.background && params.output_path.empty())) {
|
||||||
tile_manager.state.buffer.get_offset_stride(rtile.offset, rtile.stride);
|
tile_manager.state.buffer.get_offset_stride(rtile.offset, rtile.stride);
|
||||||
|
|
||||||
rtile.buffer = buffers->buffer.device_pointer;
|
rtile.buffer = buffers->buffer.device_pointer;
|
||||||
|
Loading…
Reference in New Issue
Block a user