summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-04-12 20:16:41 -0700
committerEric Anholt <[email protected]>2013-04-21 12:28:03 -0700
commite86170c2b88f9970a124479bbf47b5a7cd43d628 (patch)
treeaaa4b5f59d4bc184bbb52234eabc42c7b5867681 /src/mesa/main
parentcbe8b75b586b22006783af0ed1ebba87b00ce61a (diff)
mesa: Add performance debug for meta code.
I noticed a fallback in regnum through sysprof, and wanted a nicer way to get information about it. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/errors.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/errors.h b/src/mesa/main/errors.h
index 7d8be5aca76..1677971b194 100644
--- a/src/mesa/main/errors.h
+++ b/src/mesa/main/errors.h
@@ -73,6 +73,16 @@ _mesa_gl_debug(struct gl_context *ctx,
enum mesa_debug_severity severity,
const char *fmtString, ...) PRINTFLIKE(5, 6);
+#define _mesa_perf_debug(ctx, sev, ...) do { \
+ static GLuint msg_id = 0; \
+ if (unlikely(ctx->Const.ContextFlags & GL_CONTEXT_FLAG_DEBUG_BIT)) { \
+ _mesa_gl_debug(ctx, &msg_id, \
+ MESA_DEBUG_TYPE_PERFORMANCE, \
+ sev, \
+ __VA_ARGS__); \
+ } \
+} while (0)
+
extern void
_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
const char *msg, int len);