vc4: Wire up core pipe_debug_callback
authorRhys Kidd <rhyskidd@gmail.com>
Fri, 10 Aug 2018 16:40:09 +0000 (12:40 -0400)
committerEric Anholt <eric@anholt.net>
Thu, 20 Dec 2018 19:31:19 +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/vc4/vc4_context.c
src/gallium/drivers/vc4/vc4_context.h

index ffd7d4c8555fe72adefb4a457a3b5f2926e7675a..94969dcb133b447e965e5bfa303918115ad1be38 100644 (file)
@@ -84,6 +84,18 @@ vc4_texture_barrier(struct pipe_context *pctx, unsigned flags)
         vc4_flush(pctx);
 }
 
+static void
+vc4_set_debug_callback(struct pipe_context *pctx,
+                       const struct pipe_debug_callback *cb)
+{
+        struct vc4_context *vc4 = vc4_context(pctx);
+
+        if (cb)
+                vc4->debug = *cb;
+        else
+                memset(&vc4->debug, 0, sizeof(vc4->debug));
+}
+
 static void
 vc4_invalidate_resource(struct pipe_context *pctx, struct pipe_resource *prsc)
 {
@@ -164,6 +176,7 @@ vc4_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
         pctx->priv = priv;
         pctx->destroy = vc4_context_destroy;
         pctx->flush = vc4_pipe_flush;
+        pctx->set_debug_callback = vc4_set_debug_callback;
         pctx->invalidate_resource = vc4_invalidate_resource;
         pctx->texture_barrier = vc4_texture_barrier;
 
index 8a8d3b6d5b0caa6158865c72ba8a09c3ae9981e6..f8f47958d8f0c3b2981ffad319e327a308f688f2 100644 (file)
@@ -405,6 +405,7 @@ struct vc4_context {
         struct pipe_viewport_state viewport;
         struct vc4_constbuf_stateobj constbuf[PIPE_SHADER_TYPES];
         struct vc4_vertexbuf_stateobj vertexbuf;
+        struct pipe_debug_callback debug;
 
         struct vc4_hwperfmon *perfmon;
         /** @} */