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
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-02-12 17:06:52 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-02-12 17:06:52 +0400
commitb3b993127681eac85c88d1cd7ceb0e235b54bdb8 (patch)
tree35e7bd9b33eaa8a115ee94b1860b6b7237e41b16 /intern
parent7c3ce049ed55a756fbec1943bb5b7615a74f6c9c (diff)
Fix #34205: Cycles: Zooming in rendered mode during update out of sync with intended zoom
Made sure no pause_cond.wait() happens at the same time as session as resetting.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/render/session.cpp14
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) {