vc4: Add a debug flag for flushing after every draw.
authorEric Anholt <eric@anholt.net>
Fri, 5 Sep 2014 21:17:27 +0000 (14:17 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 9 Sep 2014 14:29:12 +0000 (07:29 -0700)
It was useful on i965, but it's even more useful for debugging tiled
renderers.

src/gallium/drivers/vc4/vc4_draw.c
src/gallium/drivers/vc4/vc4_screen.c
src/gallium/drivers/vc4/vc4_screen.h

index cf3fc03d2222284fc0060b03484a3076047c2dcc..311be6b7ec41fcec5a726ba4a01ce2c4d0f5107c 100644 (file)
@@ -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
index 793f8d396641fda6273a66ef1d8255a09aded2dd..49f5228ab395ecfe0db621e28547a5a843c946fc 100644 (file)
@@ -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 }
 };
 
index a45a6e7a365323a3bdc5340a875cccd5ed7fe705..470cb06e2bf436e81e944c8416e39de2b43411f6 100644 (file)
@@ -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