Fix Cycles viewport render doing some unnecessary work at the start.
In some cases it would load adaptive kernels or even start rendering twice because the first time the scene was not fully synced yet.
This commit is contained in:
@@ -110,9 +110,6 @@ BlenderSession::~BlenderSession()
|
||||
void BlenderSession::create()
|
||||
{
|
||||
create_session();
|
||||
|
||||
if(b_v3d)
|
||||
session->start();
|
||||
}
|
||||
|
||||
void BlenderSession::create_session()
|
||||
@@ -784,7 +781,6 @@ void BlenderSession::synchronize()
|
||||
{
|
||||
free_session();
|
||||
create_session();
|
||||
session->start();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -833,6 +829,10 @@ void BlenderSession::synchronize()
|
||||
/* reset time */
|
||||
start_resize_time = 0.0;
|
||||
}
|
||||
|
||||
/* Start rendering thread, if it's not running already. Do this
|
||||
* after all scene data has been synced at least once. */
|
||||
session->start();
|
||||
}
|
||||
|
||||
bool BlenderSession::draw(int w, int h)
|
||||
|
@@ -129,8 +129,10 @@ Session::~Session()
|
||||
|
||||
void Session::start()
|
||||
{
|
||||
if (!session_thread) {
|
||||
session_thread = new thread(function_bind(&Session::run, this));
|
||||
}
|
||||
}
|
||||
|
||||
bool Session::ready_to_reset()
|
||||
{
|
||||
@@ -830,8 +832,10 @@ void Session::set_pause(bool pause_)
|
||||
|
||||
void Session::wait()
|
||||
{
|
||||
if (session_thread) {
|
||||
session_thread->join();
|
||||
delete session_thread;
|
||||
}
|
||||
|
||||
session_thread = NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user