mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-11 04:28:58 +00:00
glClientWaitSync
appears to be a busy wait, at least on my machine. But why wait indefinitely anyway?
This commit is contained in:
parent
5c85366de2
commit
4ac619f569
@ -192,7 +192,13 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
|
|||||||
|
|
||||||
if(_fence != nullptr)
|
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);
|
glDeleteSync(_fence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user