[Mesa-dev] [PATCH] egl: Expose EGL_KHR_get_all_proc_addresses and its client extension
Chad Versace
chad.versace at linux.intel.com
Thu Nov 20 10:36:06 PST 2014
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
Cc: Daniel Kurtz <djkurtz at chromium.org>
Cc: Frank Henigman <fjhenigman at chromium.org>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
You can find this on my branch 'EGL_KHR_get_all_proc_addresses'.
http://github.com/chadversary/mesa/tree/EGL_KHR_get_all_proc_addresses
src/egl/main/eglapi.c | 17 +++++++++++++++++
src/egl/main/egldisplay.h | 1 +
src/egl/main/eglglobals.c | 4 +++-
src/egl/main/eglglobals.h | 1 +
src/egl/main/eglmisc.c | 1 +
5 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 096c3d8..a8d1e4b 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -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 exposes
+ * EGL_KHR_get_all_proc_addresses.
+ */
+ disp->Extensions.KHR_get_all_proc_addresses = EGL_TRUE;
}
/* Update applications version of major and minor if not NULL */
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index 13b9532..d4b9602 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -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;
diff --git a/src/egl/main/eglglobals.c b/src/egl/main/eglglobals.c
index cf669cf..56fe9e2 100644
--- a/src/egl/main/eglglobals.c
+++ b/src/egl/main/eglglobals.c
@@ -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"
};
diff --git a/src/egl/main/eglglobals.h b/src/egl/main/eglglobals.h
index 9046ea2..a8cf6d6 100644
--- a/src/egl/main/eglglobals.h
+++ b/src/egl/main/eglglobals.h
@@ -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;
diff --git a/src/egl/main/eglmisc.c b/src/egl/main/eglmisc.c
index 388e4b5..2f49809 100644
--- a/src/egl/main/eglmisc.c
+++ b/src/egl/main/eglmisc.c
@@ -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);
--
2.1.2.1.g5433a3e
More information about the mesa-dev
mailing list