summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglcurrent.h
diff options
context:
space:
mode:
authorKyle Brenneman <[email protected]>2016-09-12 17:50:40 -0400
committerAdam Jackson <[email protected]>2016-10-05 11:40:51 -0400
commit6a5545d3ba60a19a3bce8f62141e0991a595eeaf (patch)
tree2c2f43ea6fc78b565162a4801e89be79341d3927 /src/egl/main/eglcurrent.h
parentf8b861a8673ca49eb6e4fbcdc1cf7f6be884afe1 (diff)
egl: Track EGL_KHR_debug state when going through EGL API calls (v3)
This decorates every EGL entrypoint with _EGL_FUNC_START, which records the function name and primary dispatch object label in the current thread state. It also adds debug report functions and calls them when appropriate. This would be useful enough for debugging on its own, if the user set a breakpoint when the report function was called. We will also need this state tracked in order to expose EGL_KHR_debug. v2: - Clear the object label in more cases in _eglSetFuncName - Pass draw surface (if any) to _EGL_FUNC_START in eglSwapInterval v3: - Set dummy thread's CurrentAPI to EGL_OPENGL_ES_API not zero - Less ?: in _eglSetFuncName Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/egl/main/eglcurrent.h')
-rw-r--r--src/egl/main/eglcurrent.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/egl/main/eglcurrent.h b/src/egl/main/eglcurrent.h
index b2638fd7ab5..9ec07bac8e6 100644
--- a/src/egl/main/eglcurrent.h
+++ b/src/egl/main/eglcurrent.h
@@ -99,6 +99,28 @@ _eglGetCurrentContext(void);
extern EGLBoolean
_eglError(EGLint errCode, const char *msg);
+extern EGLLabelKHR
+_eglGetThreadLabel(void);
+
+extern void
+_eglDebugReportFull(EGLenum error, const char *command, const char *funcName,
+ EGLint type, EGLLabelKHR objectLabel, const char *message, ...);
+
+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
}