egl: Remove some can't-happen supported API checks
authorAdam Jackson <ajax@redhat.com>
Tue, 16 Aug 2022 01:46:19 +0000 (21:46 -0400)
committerMarge Bot <emma+marge@anholt.net>
Mon, 29 Aug 2022 20:31:14 +0000 (20:31 +0000)
The only other thing this could be is OpenVG, which we never create.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18128>

src/egl/main/eglapi.c

index de2c53e..13f0553 100644 (file)
@@ -1859,10 +1859,7 @@ _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|MESA]_EGL_sync. */
-   if (ctx && (ctx->Resource.Display != disp ||
-               (ctx->ClientAPI != EGL_OPENGL_ES_API &&
-                ctx->ClientAPI != EGL_OPENGL_API)))
+   if (ctx && (ctx->Resource.Display != disp))
       RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SYNC_KHR);
 
    switch (type) {
@@ -2041,10 +2038,7 @@ _eglWaitSyncCommon(_EGLDisplay *disp, _EGLSync *s, EGLint flags)
    _EGL_CHECK_SYNC(disp, s, EGL_FALSE);
    assert(disp->Extensions.KHR_wait_sync);
 
-   /* 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))
+   if (ctx == EGL_NO_CONTEXT)
       RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_FALSE);
 
    /* the API doesn't allow any flags yet */
@@ -2787,9 +2781,7 @@ _eglLockDisplayInterop(EGLDisplay dpy, EGLContext context,
    }
 
    *ctx = _eglLookupContext(context, *disp);
-   if (!*ctx ||
-       ((*ctx)->ClientAPI != EGL_OPENGL_API &&
-        (*ctx)->ClientAPI != EGL_OPENGL_ES_API)) {
+   if (!*ctx) {
       _eglUnlockDisplay(*disp);
       return MESA_GLINTEROP_INVALID_CONTEXT;
    }