Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/render/session.cpp')
-rw-r--r--intern/cycles/render/session.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
index 94cb69102d2..6ed14452c6b 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 */
@@ -208,7 +210,12 @@ void Session::run_gpu()
* wait for pause condition notify to wake up again */
thread_scoped_lock pause_lock(pause_mutex);
- if(pause || no_tiles) {
+ if(!pause && !tile_manager.done()) {
+ /* reset could have happened after no_tiles was set, before this lock.
+ * in this case we shall not wait for pause condition
+ */
+ }
+ else if(pause || no_tiles) {
update_status_time(pause, no_tiles);
while(1) {
@@ -295,6 +302,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 +492,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) {