egl: only accept APIs that are compiled in

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20839>
This commit is contained in:
Eric Engestrom 2023-01-22 09:38:29 +00:00 committed by Marge Bot
parent 68418db212
commit b3485664f3

View file

@ -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 *