Mesa (master): vc4: Set the primitive list format at the start of rendering.

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


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

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Oct 16 10:17:57 2014 +0100

vc4: Set the primitive list format at the start of rendering.

The other driver does this manually before calling into each tile, but we
can just let it get binned into the tiles (saving repeated kernel
validation on the packet).

Fixes simulator assertion failures on polygon-mode and non-auto texwrap.

---

 src/gallium/drivers/vc4/vc4_draw.c   |    9 +++++++++
 src/gallium/drivers/vc4/vc4_packet.h |    6 ++++++
 2 files changed, 15 insertions(+)

diff --git a/src/gallium/drivers/vc4/vc4_draw.c b/src/gallium/drivers/vc4/vc4_draw.c
index f3c225d..f53caf7 100644
--- a/src/gallium/drivers/vc4/vc4_draw.c
+++ b/src/gallium/drivers/vc4/vc4_draw.c
@@ -85,6 +85,15 @@ vc4_start_draw(struct vc4_context *vc4)
          */
         cl_u8(&vc4->bcl, VC4_PACKET_START_TILE_BINNING);
 
+        /* Reset the current compressed primitives format.  This gets modified
+         * by VC4_PACKET_GL_INDEXED_PRIMITIVE and
+         * VC4_PACKET_GL_ARRAY_PRIMITIVE, so it needs to be reset at the start
+         * of every tile.
+         */
+        cl_u8(&vc4->bcl, VC4_PACKET_PRIMITIVE_LIST_FORMAT);
+        cl_u8(&vc4->bcl, (VC4_PRIMITIVE_LIST_FORMAT_16_INDEX |
+                          VC4_PRIMITIVE_LIST_FORMAT_TYPE_TRIANGLES));
+
         vc4->needs_flush = true;
         vc4->draw_call_queued = true;
 }
diff --git a/src/gallium/drivers/vc4/vc4_packet.h b/src/gallium/drivers/vc4/vc4_packet.h
index e9abfd1..181f2e0 100644
--- a/src/gallium/drivers/vc4/vc4_packet.h
+++ b/src/gallium/drivers/vc4/vc4_packet.h
@@ -234,6 +234,12 @@ enum vc4_packet {
 #define VC4_RENDER_CONFIG_TILE_BUFFER_64BIT        (1 << 1)
 #define VC4_RENDER_CONFIG_MS_MODE_4X               (1 << 0)
 
+#define VC4_PRIMITIVE_LIST_FORMAT_16_INDEX         (1 << 4)
+#define VC4_PRIMITIVE_LIST_FORMAT_32_XY            (3 << 4)
+#define VC4_PRIMITIVE_LIST_FORMAT_TYPE_POINTS      (0 << 0)
+#define VC4_PRIMITIVE_LIST_FORMAT_TYPE_LINES       (1 << 0)
+#define VC4_PRIMITIVE_LIST_FORMAT_TYPE_TRIANGLES   (2 << 0)
+#define VC4_PRIMITIVE_LIST_FORMAT_TYPE_RHT         (3 << 0)
 
 enum vc4_texture_data_type {
         VC4_TEXTURE_TYPE_RGBA8888 = 0,




More information about the mesa-commit mailing list