Mesa (master): vc4: Add a debug flag for flushing after every draw.

Eric Anholt anholt at kemper.freedesktop.org
Tue Sep 9 14:30:30 UTC 2014


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Sep  5 14:17:27 2014 -0700

vc4: Add a debug flag for flushing after every draw.

It was useful on i965, but it's even more useful for debugging tiled
renderers.

---

 src/gallium/drivers/vc4/vc4_draw.c   |    3 +++
 src/gallium/drivers/vc4/vc4_screen.c |    2 ++
 src/gallium/drivers/vc4/vc4_screen.h |    1 +
 3 files changed, 6 insertions(+)

diff --git a/src/gallium/drivers/vc4/vc4_draw.c b/src/gallium/drivers/vc4/vc4_draw.c
index cf3fc03..311be6b 100644
--- a/src/gallium/drivers/vc4/vc4_draw.c
+++ b/src/gallium/drivers/vc4/vc4_draw.c
@@ -193,6 +193,9 @@ vc4_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
         vc4->resolve |= PIPE_CLEAR_COLOR0;
 
         vc4->shader_rec_count++;
+
+        if (vc4_debug & VC4_DEBUG_ALWAYS_FLUSH)
+                vc4_flush(pctx);
 }
 
 static uint32_t
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
index 793f8d3..49f5228 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -50,6 +50,8 @@ static const struct debug_named_value debug_options[] = {
           "Print during performance-related events" },
         { "norast",   VC4_DEBUG_NORAST,
           "Skip actual hardware execution of commands" },
+        { "always_flush", VC4_DEBUG_ALWAYS_FLUSH,
+          "Flush after each draw call" },
         { NULL }
 };
 
diff --git a/src/gallium/drivers/vc4/vc4_screen.h b/src/gallium/drivers/vc4/vc4_screen.h
index a45a6e7..470cb06 100644
--- a/src/gallium/drivers/vc4/vc4_screen.h
+++ b/src/gallium/drivers/vc4/vc4_screen.h
@@ -36,6 +36,7 @@ struct vc4_bo;
 #define VC4_DEBUG_SHADERDB  0x0010
 #define VC4_DEBUG_PERF      0x0020
 #define VC4_DEBUG_NORAST    0x0040
+#define VC4_DEBUG_ALWAYS_FLUSH 0x0080
 
 #define VC4_MAX_MIP_LEVELS 12
 #define VC4_MAX_TEXTURE_SAMPLERS 16




More information about the mesa-commit mailing list