Mesa (main): aux/trace: add pipe_context::set_debug_callback hook

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat May 22 14:02:41 UTC 2021


Module: Mesa
Branch: main
Commit: 4a54cb49d9875c94e68f9c27d04f43f5d871995c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4a54cb49d9875c94e68f9c27d04f43f5d871995c

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu May  6 16:04:00 2021 -0400

aux/trace: add pipe_context::set_debug_callback hook

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10899>

---

 src/gallium/auxiliary/driver_trace/tr_context.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/gallium/auxiliary/driver_trace/tr_context.c b/src/gallium/auxiliary/driver_trace/tr_context.c
index 5ef823bfcec..2bdf9a2e1a3 100644
--- a/src/gallium/auxiliary/driver_trace/tr_context.c
+++ b/src/gallium/auxiliary/driver_trace/tr_context.c
@@ -1786,6 +1786,21 @@ trace_context_set_context_param(struct pipe_context *_context,
    context->set_context_param(context, param, value);
 }
 
+static void
+trace_context_set_debug_callback(struct pipe_context *_context, const struct pipe_debug_callback *cb)
+{
+   struct trace_context *tr_context = trace_context(_context);
+   struct pipe_context *context = tr_context->pipe;
+
+   trace_dump_call_begin("pipe_context", "set_debug_callback");
+
+   trace_dump_arg(ptr, context);
+
+   trace_dump_call_end();
+
+   context->set_debug_callback(context, cb);
+}
+
 static void
 trace_context_render_condition(struct pipe_context *_context,
                                struct pipe_query *query,
@@ -2173,6 +2188,7 @@ trace_context_create(struct trace_screen *tr_scr,
    TR_CTX_INIT(texture_subdata);
    TR_CTX_INIT(invalidate_resource);
    TR_CTX_INIT(set_context_param);
+   TR_CTX_INIT(set_debug_callback);
 
 #undef TR_CTX_INIT
 



More information about the mesa-commit mailing list