Module: Mesa
Branch: main
Commit: b3485664f38cb224cedd72e2d8cdadf4e329572f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b3485664f38cb224cedd72e2d8cdadf4e329572f

Author: Eric Engestrom <[email protected]>
Date:   Sun Jan 22 09:38:29 2023 +0000

egl: only accept APIs that are compiled in

Signed-off-by: Eric Engestrom <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20839>

---

 src/egl/main/eglcurrent.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/egl/main/eglcurrent.h b/src/egl/main/eglcurrent.h
index c4d4041d713..270c7dde7a1 100644
--- a/src/egl/main/eglcurrent.h
+++ b/src/egl/main/eglcurrent.h
@@ -64,12 +64,16 @@ struct _egl_thread_info {
 static inline EGLBoolean
 _eglIsApiValid(EGLenum api)
 {
-#ifdef ANDROID
+#if HAVE_OPENGL && !defined(ANDROID)
    /* OpenGL is not a valid/supported API on Android */
-   return api == EGL_OPENGL_ES_API;
-#else
-   return (api == EGL_OPENGL_ES_API || api == EGL_OPENGL_API);
+   if (api == EGL_OPENGL_API)
+      return true;
 #endif
+#if HAVE_OPENGL_ES_1 || HAVE_OPENGL_ES_2
+   if (api == EGL_OPENGL_ES_API)
+      return true;
+#endif
+   return false;
 }
 
 extern _EGLThreadInfo *

Reply via email to