X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fegl%2Fmain%2Feglcurrent.h;h=d9a4a90174e2e62d45420ecfa5953fe66e516e38;hb=429e936948045d6314235581b79d29755b8bdc8c;hp=b922435e31f9ac217002637bdac6c0cd5445688a;hpb=6e066f76ee22909b0653ff8b89429de819e60f14;p=mesa.git diff --git a/src/egl/main/eglcurrent.h b/src/egl/main/eglcurrent.h index b922435e31f..d9a4a90174e 100644 --- a/src/egl/main/eglcurrent.h +++ b/src/egl/main/eglcurrent.h @@ -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 }