egl: Expose EGL_KHR_get_all_proc_addresses and its client extension
authorChad Versace <chad.versace@linux.intel.com>
Thu, 20 Nov 2014 18:26:38 +0000 (10:26 -0800)
committerChad Versace <chad.versace@linux.intel.com>
Mon, 8 Dec 2014 04:58:25 +0000 (20:58 -0800)
Mesa already implements the behavior of EGL_KHR_get_all_proc_addresses
and EGL_KHR_client_get_all_proc_addresses. This patch just exposes the
extension strings.

See: https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_get_all_proc_addresses.txt
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/egl/main/eglapi.c
src/egl/main/egldisplay.h
src/egl/main/eglglobals.c
src/egl/main/eglglobals.h
src/egl/main/eglmisc.c

index 096c3d8f5d84ffcbc1d16e5ed50b3ebfc80b8977..511848f93c5678d6235360930a983f086b17239a 100644 (file)
@@ -357,6 +357,23 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
 
       /* limit to APIs supported by core */
       disp->ClientAPIs &= _EGL_API_ALL_BITS;
+
+      /* EGL_KHR_get_all_proc_addresses is a corner-case extension. The spec
+       * classifies it as an EGL display extension, though conceptually it's an
+       * EGL client extension.
+       *
+       * From the EGL_KHR_get_all_proc_addresses spec:
+       *
+       *    The EGL implementation must expose the name
+       *    EGL_KHR_client_get_all_proc_addresses if and only if it exposes
+       *    EGL_KHR_get_all_proc_addresses and supports
+       *    EGL_EXT_client_extensions.
+       *
+       * Mesa unconditionally exposes both client extensions mentioned above,
+       * so the spec requires that each EGLDisplay unconditionally expose
+       * EGL_KHR_get_all_proc_addresses also.
+       */
+      disp->Extensions.KHR_get_all_proc_addresses = EGL_TRUE;
    }
 
    /* Update applications version of major and minor if not NULL */
index 13b95327bc15ddc6226046b1944bab6b803000a0..d4b9602de8a6f9354ebf32d12332f53c39a836d6 100644 (file)
@@ -97,6 +97,7 @@ struct _egl_extensions
    EGLBoolean KHR_image_base;
    EGLBoolean KHR_image_pixmap;
    EGLBoolean KHR_vg_parent_image;
+   EGLBoolean KHR_get_all_proc_addresses;
    EGLBoolean KHR_gl_texture_2D_image;
    EGLBoolean KHR_gl_texture_cubemap_image;
    EGLBoolean KHR_gl_texture_3D_image;
index cf669cff681cbd33bf4ad2ab40af1b6e4706259c..56fe9e29d8b5f926ce67ffdd18b57cefccdac2df 100644 (file)
@@ -55,7 +55,8 @@ struct _egl_global _eglGlobal =
       true, /* EGL_EXT_platform_base */
       true, /* EGL_EXT_platform_x11 */
       true, /* EGL_EXT_platform_wayland */
-      true  /* EGL_MESA_platform_gbm */
+      true, /* EGL_MESA_platform_gbm */
+      true, /* EGL_KHR_client_get_all_proc_addresses */
    },
 
    /* ClientExtensionsString */
@@ -64,6 +65,7 @@ struct _egl_global _eglGlobal =
    " EGL_EXT_platform_x11"
    " EGL_EXT_platform_wayland"
    " EGL_MESA_platform_gbm"
+   " EGL_KHR_client_get_all_proc_addresses"
 };
 
 
index 9046ea25c3c6f6f8e51e7eec8accd13a8d175e7c..a8cf6d691248294c98281e37d1b002c9aca38cbb 100644 (file)
@@ -56,6 +56,7 @@ struct _egl_global
       bool EXT_platform_x11;
       bool EXT_platform_wayland;
       bool MESA_platform_gbm;
+      bool KHR_get_all_proc_addresses;
    } ClientExtensions;
 
    const char *ClientExtensionString;
index 388e4b51b7a469c4c1857dad4b72c32c2a114d42..2f498095ebbbc119653b4e3f11f7a9e9abaf9c13 100644 (file)
@@ -101,6 +101,7 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
       _eglAppendExtension(&exts, "EGL_KHR_image");
 
    _EGL_CHECK_EXTENSION(KHR_vg_parent_image);
+   _EGL_CHECK_EXTENSION(KHR_get_all_proc_addresses);
    _EGL_CHECK_EXTENSION(KHR_gl_texture_2D_image);
    _EGL_CHECK_EXTENSION(KHR_gl_texture_cubemap_image);
    _EGL_CHECK_EXTENSION(KHR_gl_texture_3D_image);