Expose EGL_KHR_platform_* when EXT is supported
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Fri, 8 May 2020 17:23:03 +0000 (19:23 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 19 May 2020 16:41:54 +0000 (16:41 +0000)
On EGL 1.4, one had to check for the existence of EGL_EXT_platform_base
before querying the eglGetPlatformDisplayEXT() and
eglCreatePlatformWindowSurfaceEXT() symbols, to then use them if the
EGL_EXT_platform_* extension for the given platform was exposed.

Since EGL 1.5, the platform functionality was made core, which means we
can obtain the symbols unconditionally, but we can't know the EGL
version before having created a display, at which point we've already
done a platform selection by passing an EGLNativeDisplay.  The
EGL_KHR_platform_* extensions thus are used by clients to know whether
it's safe or not to dlsym() the EGL 1.5 symbols.

This commit adds those extensions when the given platform is enabled.

Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5052>

src/egl/main/eglglobals.c

index 6811048bdf7dc2d4fe2f8df5ce73dc7554f09744..f5814b2b2a1ee6381dd137e8f80755a658c88daf 100644 (file)
@@ -85,12 +85,15 @@ struct _egl_global _eglGlobal =
    "EGL_EXT_platform_device"
 #ifdef HAVE_WAYLAND_PLATFORM
    " EGL_EXT_platform_wayland"
+   " EGL_KHR_platform_wayland"
 #endif
 #ifdef HAVE_X11_PLATFORM
    " EGL_EXT_platform_x11"
+   " EGL_KHR_platform_x11"
 #endif
 #ifdef HAVE_DRM_PLATFORM
    " EGL_MESA_platform_gbm"
+   " EGL_KHR_platform_gbm"
 #endif
 #ifdef HAVE_SURFACELESS_PLATFORM
    " EGL_MESA_platform_surfaceless"