summaryrefslogtreecommitdiffstats
path: root/src/egl/main
diff options
context:
space:
mode:
authorHeinrich Fink <[email protected]>2019-07-30 15:58:20 +0200
committerDaniel Stone <[email protected]>2019-09-08 08:01:55 +0000
commit3aa4f3a4425aa29bf72ab74528d74bac19bdc994 (patch)
tree2dd26210f1cf8e29002d88c44373023895c7f07b /src/egl/main
parent8c933c9d96614ad35c17af7d390c09fc210085c4 (diff)
egl: Add GL_MESA_EGL_sync support
This commit follow OES_EGL_sync to universially enable use of EGL sync objects with desktop OpenGL contexts. Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/egl/main')
-rw-r--r--src/egl/main/eglapi.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 0cd17cebf03..bed4ddced68 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -1851,9 +1851,10 @@ _eglCreateSync(_EGLDisplay *disp, EGLenum type, const EGLAttrib *attrib_list,
(type == EGL_SYNC_FENCE_KHR || type == EGL_SYNC_NATIVE_FENCE_ANDROID))
RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SYNC_KHR);
- /* return an error if the client API doesn't support GL_OES_EGL_sync */
+ /* return an error if the client API doesn't support GL_[OES|MESA]_EGL_sync. */
if (ctx && (ctx->Resource.Display != disp ||
- ctx->ClientAPI != EGL_OPENGL_ES_API))
+ (ctx->ClientAPI != EGL_OPENGL_ES_API &&
+ ctx->ClientAPI != EGL_OPENGL_API)))
RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SYNC_KHR);
switch (type) {
@@ -2035,8 +2036,10 @@ _eglWaitSyncCommon(_EGLDisplay *disp, _EGLSync *s, EGLint flags)
_EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
assert(disp->Extensions.KHR_wait_sync);
- /* return an error if the client API doesn't support GL_OES_EGL_sync */
- if (ctx == EGL_NO_CONTEXT || ctx->ClientAPI != EGL_OPENGL_ES_API)
+ /* return an error if the client API doesn't support GL_[OES|MESA]_EGL_sync. */
+ if (ctx == EGL_NO_CONTEXT ||
+ (ctx->ClientAPI != EGL_OPENGL_ES_API &&
+ ctx->ClientAPI != EGL_OPENGL_API))
RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_FALSE);
/* the API doesn't allow any flags yet */