draw: add disabled debug code
authorKeith Whitwell <keith@tungstengraphics.com>
Tue, 27 May 2008 16:51:48 +0000 (17:51 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Tue, 27 May 2008 16:52:24 +0000 (17:52 +0100)
src/gallium/auxiliary/draw/draw_pt_emit.c
src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c

index e37256b1ff45b6e1438f892f2096c405387af4b6..cf87cde99653c3734cd153b68f5efd5b1769c9b6 100644 (file)
@@ -41,6 +41,8 @@ struct pt_emit {
 
    struct translate_cache *cache;
    unsigned prim;
+
+   const struct vertex_info *vinfo;
 };
 
 void draw_pt_emit_prepare( struct pt_emit *emit,
@@ -71,7 +73,7 @@ void draw_pt_emit_prepare( struct pt_emit *emit,
 
    /* Must do this after set_primitive() above:
     */
-   vinfo = draw->render->get_vertex_info(draw->render);
+   emit->vinfo = vinfo = draw->render->get_vertex_info(draw->render);
 
 
    /* Translate from pipeline vertices to hw vertices.
@@ -245,6 +247,17 @@ void draw_pt_emit_linear(struct pt_emit *emit,
                   vertex_count,
                   hw_verts);
 
+   if (0) {
+      unsigned i;
+      for (i = 0; i < vertex_count; i++) {
+         debug_printf("\n\n%s vertex %d:\n", __FUNCTION__, i);
+         draw_dump_emitted_vertex( emit->vinfo, 
+                                   (const uint8_t *)hw_verts + 
+                                   translate->key.output_stride * i );
+      }
+   }
+
+
    render->draw_arrays(render, start, count);
 
    render->release_vertices(render,
index 43d7095f76695377370c348436342c4a56ee02fb..85d0bdfcab0752557065554526a0e04ebbe6fffe 100644 (file)
@@ -60,6 +60,9 @@ struct fetch_shade_emit {
 
    struct draw_vs_varient_key key;
    struct draw_vs_varient *active;
+
+
+   const struct vertex_info *vinfo;
 };
 
 
@@ -85,7 +88,7 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
 
    /* Must do this after set_primitive() above:
     */
-   vinfo = draw->render->get_vertex_info(draw->render);
+   fse->vinfo = vinfo = draw->render->get_vertex_info(draw->render);
    
 
 
@@ -267,6 +270,18 @@ static void fse_run_linear( struct draw_pt_middle_end *middle,
                               0,
                               count );
    
+   if (0) {
+      unsigned i;
+      for (i = 0; i < count; i++) {
+         debug_printf("\n\n%s vertex %d: (stride %d, offset %d)\n", __FUNCTION__, i,
+                      fse->key.output_stride,
+                      fse->key.output_stride * i);
+
+         draw_dump_emitted_vertex( fse->vinfo, 
+                                   (const uint8_t *)hw_verts + fse->key.output_stride * i );
+      }
+   }
+
 
    draw->render->release_vertices( draw->render, 
                                   hw_verts, 
@@ -311,6 +326,17 @@ fse_run(struct draw_pt_middle_end *middle,
                        draw_elts, 
                        draw_count );
 
+   if (0) {
+      unsigned i;
+      for (i = 0; i < fetch_count; i++) {
+         debug_printf("\n\n%s vertex %d:\n", __FUNCTION__, i);
+         draw_dump_emitted_vertex( fse->vinfo, 
+                                   (const uint8_t *)hw_verts + 
+                                   fse->key.output_stride * i );
+      }
+   }
+
+
    draw->render->release_vertices( draw->render, 
                                    hw_verts, 
                                    fse->key.output_stride,