diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-08-01 14:39:05 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-08-01 14:57:43 +0400 |
commit | 42aef164f44e90df0e85cea4361c0537d11c925d (patch) | |
tree | 7498801cf4bf9e65a9dcfa371817fccb8db61eb5 /intern | |
parent | 2f2bf513e97a3955f3d98582bf7e837ca44b8009 (diff) |
Fix T41197: Blender freezes to infinite loop when switching to PAUSED Cycles rendered viewport
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/blender_session.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index 37aab76adbc..7e104d5bb41 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -88,6 +88,7 @@ void BlenderSession::create_session() { SceneParams scene_params = BlenderSync::get_scene_params(b_scene, background); SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background); + bool session_pause = BlenderSync::get_session_pause(b_scene, background); /* reset status/progress */ last_status = ""; @@ -107,15 +108,17 @@ void BlenderSession::create_session() session->scene = scene; session->progress.set_update_callback(function_bind(&BlenderSession::tag_redraw, this)); session->progress.set_cancel_callback(function_bind(&BlenderSession::test_cancel, this)); - session->set_pause(BlenderSync::get_session_pause(b_scene, background)); + session->set_pause(session_pause); /* create sync */ sync = new BlenderSync(b_engine, b_data, b_scene, scene, !background, session->progress, session_params.device.type == DEVICE_CPU); if(b_v3d) { - /* full data sync */ - sync->sync_data(b_v3d, b_engine.camera_override(), &python_thread_state); - sync->sync_view(b_v3d, b_rv3d, width, height); + if(session_pause == false) { + /* full data sync */ + sync->sync_data(b_v3d, b_engine.camera_override(), &python_thread_state); + sync->sync_view(b_v3d, b_rv3d, width, height); + } } else { /* for final render we will do full data sync per render layer, only @@ -627,6 +630,7 @@ void BlenderSession::synchronize() /* on session/scene parameter changes, we recreate session entirely */ SceneParams scene_params = BlenderSync::get_scene_params(b_scene, background); SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background); + bool session_pause = BlenderSync::get_session_pause(b_scene, background); if(session->params.modified(session_params) || scene->params.modified(scene_params)) @@ -639,12 +643,18 @@ void BlenderSession::synchronize() /* increase samples, but never decrease */ session->set_samples(session_params.samples); - session->set_pause(BlenderSync::get_session_pause(b_scene, background)); + session->set_pause(session_pause); /* copy recalc flags, outside of mutex so we can decide to do the real * synchronization at a later time to not block on running updates */ sync->sync_recalc(); + /* don't do synchronization if on pause */ + if(session_pause) { + tag_update(); + return; + } + /* try to acquire mutex. if we don't want to or can't, come back later */ if(!session->ready_to_reset() || !session->scene->mutex.try_lock()) { tag_update(); @@ -720,10 +730,12 @@ bool BlenderSession::draw(int w, int h) if(reset) { SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background); BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_scene, b_v3d, b_rv3d, scene->camera, width, height); + bool session_pause = BlenderSync::get_session_pause(b_scene, background); - session->reset(buffer_params, session_params.samples); - - start_resize_time = 0.0; + if(session_pause == false) { + session->reset(buffer_params, session_params.samples); + start_resize_time = 0.0; + } } } else { |