r300g: Add VBO dumper for SW TCL.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Wed, 12 May 2010 17:10:54 +0000 (10:10 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Wed, 12 May 2010 17:16:19 +0000 (10:16 -0700)
Commented out, not easily enabled. *Very* noisy.

src/gallium/drivers/r300/r300_render.c

index db71960e7ec8d624667bf0a650c3074b6c44585a..8795410efde5604e65b82b764ec7c608e3f3d2e0 100644 (file)
@@ -926,6 +926,8 @@ static void r500_render_draw_arrays(struct vbuf_render* render,
 {
     struct r300_render* r300render = r300_render(render);
     struct r300_context* r300 = r300render->r300;
+    uint8_t* ptr;
+    unsigned i;
 
     CS_LOCALS(r300);
 
@@ -933,6 +935,23 @@ static void r500_render_draw_arrays(struct vbuf_render* render,
 
     DBG(r300, DBG_DRAW, "r300: Doing vbuf render, count %d\n", count);
 
+    /* Uncomment to dump all VBOs rendered through this interface.
+     * Slow and noisy!
+    ptr = pipe_buffer_map(&r300render->r300->context,
+                          r300render->vbo, PIPE_TRANSFER_READ,
+                          &r300render->vbo_transfer);
+
+    for (i = 0; i < count; i++) {
+        printf("r300: Vertex %d\n", i);
+        draw_dump_emitted_vertex(&r300->vertex_info, ptr);
+        ptr += r300->vertex_info.size * 4;
+        printf("\n");
+    }
+
+    pipe_buffer_unmap(&r300render->r300->context, r300render->vbo,
+        r300render->vbo_transfer);
+    */
+
     BEGIN_CS(2);
     OUT_CS_PKT3(R300_PACKET3_3D_DRAW_VBUF_2, 0);
     OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (count << 16) |