Break the loop with glClientWaitSync also when GL_CONDITION_SATISFIED is returned.

The GL_CONDITION_SATISFIED says that the sync was signaled before the timeout expired. In this case there is no reason to make another glClientWaitSync execution.
This commit is contained in:
Deve 2016-08-20 09:31:29 +02:00
parent d5fe015ba7
commit 150e40e4e8

View File

@ -654,10 +654,13 @@ PROFILER_POP_CPU_MARKER();
PROFILER_PUSH_CPU_MARKER("- Sync Stall", 0xFF, 0x0, 0x0);
GLenum reason = glClientWaitSync(m_sync, GL_SYNC_FLUSH_COMMANDS_BIT, 0);
while (reason != GL_ALREADY_SIGNALED)
if (reason != GL_ALREADY_SIGNALED)
{
if (reason == GL_WAIT_FAILED) break;
reason = glClientWaitSync(m_sync, GL_SYNC_FLUSH_COMMANDS_BIT, 1000000);
do
{
reason = glClientWaitSync(m_sync, GL_SYNC_FLUSH_COMMANDS_BIT, 1000000);
}
while (reason == GL_TIMEOUT_EXPIRED);
}
glDeleteSync(m_sync);
PROFILER_POP_CPU_MARKER();