From 2ef530cf68f7b837db6750e7a4b1ba9e71aad062 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 15 Feb 2013 10:42:32 -0700 Subject: 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 --- src/gallium/drivers/trace/tr_context.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gallium/drivers/trace/tr_context.h') 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; } -- cgit v1.2.3