Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 23c0542

Browse files
committed
Back out 8b8db1d07846 (bug 855178) for asserting
1 parent 347a7c2 commit 23c0542

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

gfx/gl/SharedSurfaceGL.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,22 @@ SharedSurface_GLTexture::WaitSync()
365365
// We must have used glFinish instead of glFenceSync.
366366
return true;
367367
}
368-
MOZ_ASSERT(mConsGL->IsExtensionSupported(GLContext::ARB_sync));
368+
MOZ_ASSERT(mGL->IsExtensionSupported(GLContext::ARB_sync));
369369

370-
mConsGL->fWaitSync(mSync,
371-
0,
372-
LOCAL_GL_TIMEOUT_IGNORED);
370+
GLuint64 waitMS = 500;
371+
const GLuint64 nsPerMS = 1000 * 1000;
372+
GLuint64 waitNS = waitMS * nsPerMS;
373+
GLenum status = mGL->fClientWaitSync(mSync,
374+
0,
375+
waitNS);
373376

374-
mConsGL->fDeleteSync(mSync);
377+
if (status != LOCAL_GL_CONDITION_SATISFIED &&
378+
status != LOCAL_GL_ALREADY_SIGNALED)
379+
{
380+
return false;
381+
}
382+
383+
mGL->fDeleteSync(mSync);
375384
mSync = 0;
376385

377386
return true;

0 commit comments

Comments
 (0)