This repository was archived by the owner on Jul 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments