summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/trace/tr_context.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-02-15 10:42:32 -0700
committerBrian Paul <[email protected]>2013-02-15 11:11:34 -0700
commit2ef530cf68f7b837db6750e7a4b1ba9e71aad062 (patch)
treeebb021cefd1833f4ddf632b20a49a8bece819cff /src/gallium/drivers/trace/tr_context.h
parent82d62cf04f3c585ba324fcef16417fbee4a3d220 (diff)
trace: add context pointer sanity checking
To help catch mixed up context pointer bugs in the future, add a trace_context_check() function and some new assertions. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/trace/tr_context.h')
-rw-r--r--src/gallium/drivers/trace/tr_context.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/trace/tr_context.h b/src/gallium/drivers/trace/tr_context.h
index dadbe561180..90883d71239 100644
--- a/src/gallium/drivers/trace/tr_context.h
+++ b/src/gallium/drivers/trace/tr_context.h
@@ -50,10 +50,17 @@ struct trace_context
};
+void
+trace_context_check(const struct pipe_context *pipe);
+
+
static INLINE struct trace_context *
trace_context(struct pipe_context *pipe)
{
assert(pipe);
+#ifdef DEBUG
+ trace_context_check(pipe);
+#endif
return (struct trace_context *)pipe;
}