egl: drop unused _EGLDriver from QueryBufferAge()
[mesa.git] / src / egl / main / eglcurrent.h
index b922435e31f9ac217002637bdac6c0cd5445688a..d9a4a90174e2e62d45420ecfa5953fe66e516e38 100644 (file)
@@ -54,6 +54,14 @@ struct _egl_thread_info
    EGLint LastError;
    _EGLContext *CurrentContext;
    EGLenum CurrentAPI;
+   EGLLabelKHR Label;
+
+   /**
+    * The name of the EGL function that's being called at the moment. This is
+    * used to report the function name to the EGL_KHR_debug callback.
+    */
+   const char *CurrentFuncName;
+   EGLLabelKHR CurrentObjectLabel;
 };
 
 
@@ -91,6 +99,21 @@ _eglGetCurrentContext(void);
 extern EGLBoolean
 _eglError(EGLint errCode, const char *msg);
 
+extern void
+_eglDebugReport(EGLenum error, const char *funcName,
+      EGLint type, const char *message, ...);
+
+#define _eglReportCritical(error, funcName, ...) \
+    _eglDebugReport(error, funcName, EGL_DEBUG_MSG_CRITICAL_KHR, __VA_ARGS__)
+
+#define _eglReportError(error, funcName, ...) \
+    _eglDebugReport(error, funcName, EGL_DEBUG_MSG_ERROR_KHR, __VA_ARGS__)
+
+#define _eglReportWarn(funcName, ...) \
+    _eglDebugReport(EGL_SUCCESS, funcName, EGL_DEBUG_MSG_WARN_KHR, __VA_ARGS__)
+
+#define _eglReportInfo(funcName, ...) \
+    _eglDebugReport(EGL_SUCCESS, funcName, EGL_DEBUG_MSG_INFO_KHR, __VA_ARGS__)
 
 #ifdef __cplusplus
 }