Insert two fields into _egl_global to hold the client extensions and
statically initialize them:
ClientExtensions // a struct of bools
ClientExtensionString
Post-patch, Mesa supports exactly one client extension,
EGL_EXT_client_extensions.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
#include <stdlib.h>
#include <string.h>
+#include "eglglobals.h"
#include "eglcontext.h"
#include "egldisplay.h"
#include "egltypedefs.h"
const char * EGLAPIENTRY
eglQueryString(EGLDisplay dpy, EGLint name)
{
- _EGLDisplay *disp = _eglLockDisplay(dpy);
+ _EGLDisplay *disp;
_EGLDriver *drv;
const char *ret;
+ if (dpy == EGL_NO_DISPLAY && name == EGL_EXTENSIONS) {
+ RETURN_EGL_SUCCESS(NULL, _eglGlobal.ClientExtensionString);
+ }
+
+ disp = _eglLockDisplay(dpy);
_EGL_CHECK_DISPLAY(disp, NULL, drv);
ret = drv->API.QueryString(drv, disp, name);
_eglUnloadDrivers, /* always called last */
_eglFiniDisplay
},
+
+ /* ClientExtensions */
+ {
+ true /* EGL_EXT_client_extensions */
+ },
+
+ /* ClientExtensionsString */
+ "EGL_EXT_client_extensions"
};
#ifndef EGLGLOBALS_INCLUDED
#define EGLGLOBALS_INCLUDED
+#include <stdbool.h>
#include "egltypedefs.h"
#include "eglmutex.h"
EGLint NumAtExitCalls;
void (*AtExitCalls[10])(void);
+
+ struct _egl_client_extensions {
+ bool EXT_client_extensions;
+ } ClientExtensions;
+
+ const char *ClientExtensionString;
};