diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-04-15 17:19:05 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-04-15 17:19:23 +0400 |
commit | 976f59ab8cb4ee8822a06ed8c75350460afa2220 (patch) | |
tree | b63cff43103ad8ad93a937862d3e73afee5165ef /intern/cycles | |
parent | 72308669cebd401535bc533a6c1af9e6f420438e (diff) |
Fix cycles standalone not writing images in background mode properly.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/render/session.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp index 23acc969b8a..fec49390dde 100644 --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -81,6 +81,7 @@ Session::Session(const SessionParams& params_) Session::~Session() { if(session_thread) { + /* wait for session thread to end */ progress.set_cancel("Exiting"); gpu_need_tonemap = false; @@ -95,13 +96,19 @@ Session::~Session() 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(); progress.set_status("Writing Image", params.output_path); display->write(device, params.output_path); } + /* clean up */ foreach(RenderBuffers *buffers, tile_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 * 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); rtile.buffer = buffers->buffer.device_pointer; |