Mesa (master): vc4: Add dumping of VC4_PACKET_GL_INDEXED_PRIMITIVE.

Eric Anholt anholt at kemper.freedesktop.org
Fri Oct 23 17:12:52 UTC 2015


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Oct 23 15:26:12 2015 +0100

vc4: Add dumping of VC4_PACKET_GL_INDEXED_PRIMITIVE.

---

 src/gallium/drivers/vc4/vc4_cl_dump.c |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/vc4/vc4_cl_dump.c b/src/gallium/drivers/vc4/vc4_cl_dump.c
index 5a24e02..476d2b5 100644
--- a/src/gallium/drivers/vc4/vc4_cl_dump.c
+++ b/src/gallium/drivers/vc4/vc4_cl_dump.c
@@ -22,6 +22,7 @@
  */
 
 #include "util/u_math.h"
+#include "util/u_prim.h"
 #include "util/macros.h"
 #include "vc4_context.h"
 
@@ -163,6 +164,26 @@ dump_VC4_PACKET_LOAD_TILE_BUFFER_GENERAL(void *cl, uint32_t offset, uint32_t hw_
 }
 
 static void
+dump_VC4_PACKET_GL_INDEXED_PRIMITIVE(void *cl, uint32_t offset, uint32_t hw_offset)
+{
+        uint8_t *b = cl + offset;
+        uint32_t *count = cl + offset + 1;
+        uint32_t *ib_offset = cl + offset + 5;
+        uint32_t *max_index = cl + offset + 9;
+
+        fprintf(stderr, "0x%08x 0x%08x:      0x%02x %s %s\n",
+                offset, hw_offset,
+                b[0], (b[0] & VC4_INDEX_BUFFER_U16) ? "16-bit" : "8-bit",
+                u_prim_name(b[0] & 0x7));
+        fprintf(stderr, "0x%08x 0x%08x:           %d verts\n",
+                offset + 1, hw_offset + 1, *count);
+        fprintf(stderr, "0x%08x 0x%08x:      0x%08x IB offset\n",
+                offset + 5, hw_offset + 5, *ib_offset);
+        fprintf(stderr, "0x%08x 0x%08x:      0x%08x max index\n",
+                offset + 9, hw_offset + 9, *max_index);
+}
+
+static void
 dump_VC4_PACKET_FLAT_SHADE_FLAGS(void *cl, uint32_t offset, uint32_t hw_offset)
 {
         uint32_t *bits = cl + offset;
@@ -358,7 +379,7 @@ static const struct packet_info {
         PACKET_DUMP(VC4_PACKET_STORE_TILE_BUFFER_GENERAL),
         PACKET_DUMP(VC4_PACKET_LOAD_TILE_BUFFER_GENERAL),
 
-        PACKET(VC4_PACKET_GL_INDEXED_PRIMITIVE),
+        PACKET_DUMP(VC4_PACKET_GL_INDEXED_PRIMITIVE),
         PACKET(VC4_PACKET_GL_ARRAY_PRIMITIVE),
 
         PACKET(VC4_PACKET_COMPRESSED_PRIMITIVE),




More information about the mesa-commit mailing list