gl_staging_buffer: Use glGetSynciv instead of glClientWaitSync

glGetSynciv is the intended API to query fence's signaled status.
This commit is contained in:
ReinUsesLisp
2019-08-16 21:56:08 -03:00
parent 58659a702d
commit e3ec288568

View File

@@ -87,19 +87,10 @@ public:
if (!sync) {
return true;
}
switch (glClientWaitSync(sync, 0, 0)) {
case GL_TIMEOUT_EXPIRED:
// The fence is unavailable
GLint status;
glGetSynciv(sync, GL_SYNC_STATUS, sizeof(GLint), nullptr, &status);
if (status == GL_UNSIGNALED) {
return false;
case GL_ALREADY_SIGNALED:
case GL_CONDITION_SATISFIED:
break;
case GL_WAIT_FAILED:
UNREACHABLE_MSG("Fence wait failed");
break;
default:
UNREACHABLE_MSG("Unknown glClientWaitSync result");
break;
}
// The fence has been signaled, we can destroy it
glDeleteSync(sync);