Check OpenGL passed fences with glClientWaitSync()
This patch fixes an issue in the check of passed OpenGL fences. Currently Dawn checks if an OpenGL fence is passed with glGetSynciv(sync, GL_SYNC_CONDITION, sizeof(GLint), &length, &status), which always returns GL_SYNC_GPU_COMMANDS_COMPLETE and is meaningless. This patch uses glClientWaitSync() to check if a fence is passed instead. BUG=dawn:137 Change-Id: Iff6b18bcc7155b06bde98ff68c7ed104a27bfe55 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6800 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
parent
f54bb68f47
commit
f8a1041e99
|
@ -125,15 +125,11 @@ namespace dawn_native { namespace opengl {
|
|||
GLsync sync = mFencesInFlight.front().first;
|
||||
Serial fenceSerial = mFencesInFlight.front().second;
|
||||
|
||||
GLint status = 0;
|
||||
GLsizei length;
|
||||
glGetSynciv(sync, GL_SYNC_CONDITION, sizeof(GLint), &length, &status);
|
||||
ASSERT(length == 1);
|
||||
|
||||
// Fence are added in order, so we can stop searching as soon
|
||||
// as we see one that's not ready.
|
||||
if (!status) {
|
||||
return;
|
||||
GLenum result = glClientWaitSync(sync, GL_SYNC_FLUSH_COMMANDS_BIT, 0);
|
||||
if (result == GL_TIMEOUT_EXPIRED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
glDeleteSync(sync);
|
||||
|
|
Loading…
Reference in New Issue