summaryrefslogtreecommitdiff
path: root/src/mapi/glapi/glapi.h
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-09-09 12:59:14 -0400
committerKristian Høgsberg <krh@bitplanet.net>2010-09-09 13:21:15 -0400
commitb9abc6139a310677a37754ea7172d976dbf56979 (patch)
treedd42377907938fe8a5e9eb3c24ec3df678a0fe25 /src/mapi/glapi/glapi.h
parent94118fe2d4b1e5d0b9f39d9d2c44706db462e97e (diff)
glapi: Implement optional dispatch logging
There's a useful feature buried in glapi to log all API calls to stderr. Unfortunately it requires editing the code and then it's enabled unconditionally for that build. This patch builds in API logging for debug builds and makes it run-time switchable by setting MESA_DEBUG=dispatch.
Diffstat (limited to 'src/mapi/glapi/glapi.h')
-rw-r--r--src/mapi/glapi/glapi.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h
index a0bb078106..2fa580283e 100644
--- a/src/mapi/glapi/glapi.h
+++ b/src/mapi/glapi/glapi.h
@@ -94,7 +94,7 @@ _GLAPI_EXPORT extern __thread void * _glapi_tls_Context
_GLAPI_EXPORT extern const struct _glapi_table *_glapi_Dispatch;
_GLAPI_EXPORT extern const void *_glapi_Context;
-# define GET_DISPATCH() _glapi_tls_Dispatch
+# define GET_DISPATCH(t) _glapi_tls_Dispatch
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context
#else
@@ -167,6 +167,12 @@ _glapi_get_proc_name(unsigned int offset);
_GLAPI_EXPORT unsigned long
_glthread_GetID(void);
+_GLAPI_EXPORT int
+_glapi_logging_available(void);
+
+_GLAPI_EXPORT void
+_glapi_enable_logging(void (*func)(void *data, const char *fmt, ...),
+ void *data);
/*
* These stubs are kept so that the old DRI drivers still load.