Fix T39420: Cycles viewport/preview flickers, when moving mouse across editors

Issue was caused by the wrong usage of OCIO GLSL binding API. To make it
work properly on pre-GLSL-1.3 drivers shader is to be enabled after the
texture is binded to the opengl context. Otherwise it wouldn't know the
proper texture size.

This is actually a regression in 2.70 and to be ported to 'a'.
This commit is contained in:
Sergey Sharybin
2014-03-26 14:57:30 +06:00
parent 3b0832dd86
commit 74518b2826
9 changed files with 51 additions and 27 deletions

View File

@@ -151,7 +151,7 @@ void Session::reset_gpu(BufferParams& buffer_params, int samples)
pause_cond.notify_all();
}
bool Session::draw_gpu(BufferParams& buffer_params)
bool Session::draw_gpu(BufferParams& buffer_params, DeviceDrawParams& draw_params)
{
/* block for buffer access */
thread_scoped_lock display_lock(display_mutex);
@@ -170,7 +170,7 @@ bool Session::draw_gpu(BufferParams& buffer_params)
gpu_need_tonemap_cond.notify_all();
}
display->draw(device);
display->draw(device, draw_params);
if(display_outdated && (time_dt() - reset_time) > params.text_timeout)
return false;
@@ -315,7 +315,7 @@ void Session::reset_cpu(BufferParams& buffer_params, int samples)
pause_cond.notify_all();
}
bool Session::draw_cpu(BufferParams& buffer_params)
bool Session::draw_cpu(BufferParams& buffer_params, DeviceDrawParams& draw_params)
{
thread_scoped_lock display_lock(display_mutex);
@@ -324,7 +324,7 @@ bool Session::draw_cpu(BufferParams& buffer_params)
/* then verify the buffers have the expected size, so we don't
* draw previous results in a resized window */
if(!buffer_params.modified(display->params)) {
display->draw(device);
display->draw(device, draw_params);
if(display_outdated && (time_dt() - reset_time) > params.text_timeout)
return false;
@@ -624,12 +624,12 @@ void Session::run()
progress.set_update();
}
bool Session::draw(BufferParams& buffer_params)
bool Session::draw(BufferParams& buffer_params, DeviceDrawParams &draw_params)
{
if(device_use_gl)
return draw_gpu(buffer_params);
return draw_gpu(buffer_params, draw_params);
else
return draw_cpu(buffer_params);
return draw_cpu(buffer_params, draw_params);
}
void Session::reset_(BufferParams& buffer_params, int samples)