egl: inline eglSwapInterval() fallback
[mesa.git] / src / egl / main / eglglobals.h
index 04b96099a3b8a451d48e9dca3a8375adc7c0e78d..fc3b6bd62a775a3ed735cd15bae98aea3e5ec39f 100644 (file)
 
 #include "egltypedefs.h"
 
+enum
+{
+    _EGL_DEBUG_BIT_CRITICAL = 0x1,
+    _EGL_DEBUG_BIT_ERROR = 0x2,
+    _EGL_DEBUG_BIT_WARN = 0x4,
+    _EGL_DEBUG_BIT_INFO = 0x8,
+};
 
 /**
  * Global library data
@@ -47,19 +54,25 @@ struct _egl_global
    /* the list of all displays */
    _EGLDisplay *DisplayList;
 
+   _EGLDevice *DeviceList;
+
    EGLint NumAtExitCalls;
    void (*AtExitCalls[10])(void);
 
-   struct _egl_client_extensions {
-      bool EXT_client_extensions;
-      bool EXT_platform_base;
-      bool EXT_platform_x11;
-      bool EXT_platform_wayland;
-      bool MESA_platform_gbm;
-      bool KHR_get_all_proc_addresses;
-   } ClientExtensions;
-
+   /*
+    * Under libglvnd, the client extension string has to be split into two
+    * strings, one for platform extensions, and one for everything else.
+    * For a non-glvnd build create a concatenated one.
+    */
+#if USE_LIBGLVND
+   const char *ClientOnlyExtensionString;
+   const char *PlatformExtensionString;
+#else
    const char *ClientExtensionString;
+#endif
+
+   EGLDEBUGPROCKHR debugCallback;
+   unsigned int debugTypesEnabled;
 };
 
 
@@ -69,5 +82,16 @@ extern struct _egl_global _eglGlobal;
 extern void
 _eglAddAtExitCall(void (*func)(void));
 
+static inline unsigned int DebugBitFromType(EGLenum type)
+{
+   assert(type >= EGL_DEBUG_MSG_CRITICAL_KHR && type <= EGL_DEBUG_MSG_INFO_KHR);
+   return (1 << (type - EGL_DEBUG_MSG_CRITICAL_KHR));
+}
+
+/**
+ * Perform validity checks on a generic pointer.
+ */
+extern EGLBoolean
+_eglPointerIsDereferencable(void *p);
 
 #endif /* EGLGLOBALS_INCLUDED */