1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-06 01:28:57 +00:00

glClientWaitSync appears to be a busy wait, at least on my machine. But why wait indefinitely anyway?

This commit is contained in:
Thomas Harte 2016-06-29 21:32:47 -04:00
parent 5c85366de2
commit 4ac619f569

View File

@ -192,7 +192,13 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
if(_fence != nullptr)
{
glClientWaitSync(_fence, GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
// if the GPU is still busy, don't wait; we'll catch it next time
if(glClientWaitSync(_fence, GL_SYNC_FLUSH_COMMANDS_BIT, 0) == GL_TIMEOUT_EXPIRED)
{
_draw_mutex->unlock();
return;
}
glDeleteSync(_fence);
}