Mesa (master): vc4: Add some comments about state management.

Eric Anholt anholt at kemper.freedesktop.org
Fri Oct 17 12:14:12 UTC 2014


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Oct 17 09:40:12 2014 +0100

vc4: Add some comments about state management.

---

 src/gallium/drivers/vc4/vc4_context.c |    6 ++++++
 src/gallium/drivers/vc4/vc4_draw.c    |    5 +++++
 2 files changed, 11 insertions(+)

diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c
index bcbb004..205f81d 100644
--- a/src/gallium/drivers/vc4/vc4_context.c
+++ b/src/gallium/drivers/vc4/vc4_context.c
@@ -319,6 +319,12 @@ vc4_flush(struct pipe_context *pctx)
 
         vc4->needs_flush = false;
         vc4->draw_call_queued = false;
+
+        /* We have no hardware context saved between our draw calls, so we
+         * need to flag the next draw as needing all state emitted.  Emitting
+         * all state at the start of our draws is also what ensures that we
+         * return to the state we need after a previous tile has finished.
+         */
         vc4->dirty = ~0;
         vc4->resolve = 0;
         vc4->cleared = 0;
diff --git a/src/gallium/drivers/vc4/vc4_draw.c b/src/gallium/drivers/vc4/vc4_draw.c
index 0938a76..f3c225d 100644
--- a/src/gallium/drivers/vc4/vc4_draw.c
+++ b/src/gallium/drivers/vc4/vc4_draw.c
@@ -78,6 +78,11 @@ vc4_start_draw(struct vc4_context *vc4)
               VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE_32 |
               VC4_BIN_CONFIG_ALLOC_INIT_BLOCK_SIZE_32);
 
+        /* START_TILE_BINNING resets the statechange counters in the hardware,
+         * which are what is used when a primitive is binned to a tile to
+         * figure out what new state packets need to be written to that tile's
+         * command list.
+         */
         cl_u8(&vc4->bcl, VC4_PACKET_START_TILE_BINNING);
 
         vc4->needs_flush = true;




More information about the mesa-commit mailing list