diff options
-rw-r--r-- | intern/cycles/render/session.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp index 94cb69102d2..7a40e0d04b6 100644 --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -132,6 +132,8 @@ bool Session::ready_to_reset() void Session::reset_gpu(BufferParams& buffer_params, int samples) { + thread_scoped_lock pause_lock(pause_mutex); + /* block for buffer acces and reset immediately. we can't do this * in the thread, because we need to allocate an OpenGL buffer, and * that only works in the main thread */ @@ -295,6 +297,7 @@ void Session::run_gpu() void Session::reset_cpu(BufferParams& buffer_params, int samples) { thread_scoped_lock reset_lock(delayed_reset.mutex); + thread_scoped_lock pause_lock(pause_mutex); display_outdated = true; reset_time = time_dt(); @@ -484,7 +487,16 @@ void Session::run_cpu() * wait for pause condition notify to wake up again */ thread_scoped_lock pause_lock(pause_mutex); - if(pause || no_tiles) { + if(!pause && delayed_reset.do_reset) { + /* reset once to start */ + thread_scoped_lock reset_lock(delayed_reset.mutex); + thread_scoped_lock buffers_lock(buffers_mutex); + thread_scoped_lock display_lock(display_mutex); + + reset_(delayed_reset.params, delayed_reset.samples); + delayed_reset.do_reset = false; + } + else if(pause || no_tiles) { update_status_time(pause, no_tiles); while(1) { |