Module: Mesa
Branch: master
Commit: 9e41a514a8aabe209e7cc999a609c9a0a252b3d7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e41a514a8aabe209e7cc999a609c9a0a252b3d7

Author: Erico Nunes <[email protected]>
Date:   Sat Aug  3 10:51:58 2019 +0200

lima: add support for debug callback

This adds support for glDebugMessageCallback which is required to
support shader-db reports.

Signed-off-by: Erico Nunes <[email protected]>
Reviewed-by: Qiang Yu <[email protected]>

---

 src/gallium/drivers/lima/lima_context.c | 13 +++++++++++++
 src/gallium/drivers/lima/lima_context.h |  2 ++
 2 files changed, 15 insertions(+)

diff --git a/src/gallium/drivers/lima/lima_context.c 
b/src/gallium/drivers/lima/lima_context.c
index 558d2346653..3c3887001bf 100644
--- a/src/gallium/drivers/lima/lima_context.c
+++ b/src/gallium/drivers/lima/lima_context.c
@@ -166,6 +166,18 @@ plb_pp_stream_compare(const void *key1, const void *key2)
    return memcmp(key1, key2, sizeof(struct lima_ctx_plb_pp_stream_key)) == 0;
 }
 
+static void
+lima_set_debug_callback(struct pipe_context *pctx,
+                        const struct pipe_debug_callback *cb)
+{
+   struct lima_context *ctx = lima_context(pctx);
+
+   if (cb)
+      ctx->debug = *cb;
+   else
+      memset(&ctx->debug, 0, sizeof(ctx->debug));
+}
+
 struct pipe_context *
 lima_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
 {
@@ -184,6 +196,7 @@ lima_context_create(struct pipe_screen *pscreen, void 
*priv, unsigned flags)
 
    ctx->base.screen = pscreen;
    ctx->base.destroy = lima_context_destroy;
+   ctx->base.set_debug_callback = lima_set_debug_callback;
 
    lima_resource_context_init(ctx);
    lima_fence_context_init(ctx);
diff --git a/src/gallium/drivers/lima/lima_context.h 
b/src/gallium/drivers/lima/lima_context.h
index c16baeef0ba..0b232d72d1d 100644
--- a/src/gallium/drivers/lima/lima_context.h
+++ b/src/gallium/drivers/lima/lima_context.h
@@ -242,6 +242,8 @@ struct lima_context {
    struct lima_submit *pp_submit;
 
    int id;
+
+   struct pipe_debug_callback debug;
 };
 
 static inline struct lima_context *

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to