struct pipe_context *pipe = tr_ctx->pipe;
struct pipe_sampler_view *view = tr_view->sampler_view;
+ assert(_view->context == _pipe);
+
trace_dump_call_begin("pipe_context", "sampler_view_destroy");
trace_dump_arg(ptr, pipe);
error1:
return pipe;
}
+
+
+/**
+ * Sanity checker: check that the given context really is a
+ * trace context (and not the wrapped driver's context).
+ */
+void
+trace_context_check(const struct pipe_context *pipe)
+{
+ struct trace_context *tr_ctx = (struct trace_context *) pipe;
+ assert(tr_ctx->base.destroy == trace_context_destroy);
+}
+
};
+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;
}
void
trace_surf_destroy(struct trace_surface *tr_surf)
{
+ trace_context_check(tr_surf->base.context);
pipe_resource_reference(&tr_surf->base.texture, NULL);
pipe_surface_reference(&tr_surf->surface, NULL);
FREE(tr_surf);