v3d: Wire up core pipe_debug_callback
authorRhys Kidd <rhyskidd@gmail.com>
Fri, 10 Aug 2018 16:40:10 +0000 (12:40 -0400)
committerEric Anholt <eric@anholt.net>
Thu, 20 Dec 2018 19:31:16 +0000 (11:31 -0800)
This lets the driver use pipe_debug_message() for GL_ARB_debug_output.

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/drivers/v3d/v3d_context.c
src/gallium/drivers/v3d/v3d_context.h

index 36c8f497824acdc4054a7d7fde2b217304ca4395..1b148ecda2a0d2b6f61f241e590850f62341c7d9 100644 (file)
@@ -65,6 +65,18 @@ v3d_pipe_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
         }
 }
 
+static void
+v3d_set_debug_callback(struct pipe_context *pctx,
+                       const struct pipe_debug_callback *cb)
+{
+        struct v3d_context *v3d = v3d_context(pctx);
+
+        if (cb)
+                v3d->debug = *cb;
+        else
+                memset(&v3d->debug, 0, sizeof(v3d->debug));
+}
+
 static void
 v3d_invalidate_resource(struct pipe_context *pctx, struct pipe_resource *prsc)
 {
@@ -139,6 +151,7 @@ v3d_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
         pctx->priv = priv;
         pctx->destroy = v3d_context_destroy;
         pctx->flush = v3d_pipe_flush;
+        pctx->set_debug_callback = v3d_set_debug_callback;
         pctx->invalidate_resource = v3d_invalidate_resource;
 
         if (screen->devinfo.ver >= 41) {
index 575b74f494016cc95c766ad28fad32e1af01c087..7f03836d9ce6d0ad28029ccab53780f2508b9d26 100644 (file)
@@ -433,6 +433,7 @@ struct v3d_context {
         struct v3d_vertexbuf_stateobj vertexbuf;
         struct v3d_streamout_stateobj streamout;
         struct v3d_bo *current_oq;
+        struct pipe_debug_callback debug;
         /** @} */
 };