gallium/draw: add ability to print out active pipeline stages
authorKeith Whitwell <keithw@vmware.com>
Tue, 28 Apr 2009 13:50:05 +0000 (14:50 +0100)
committerKeith Whitwell <keithw@vmware.com>
Tue, 28 Apr 2009 17:15:17 +0000 (18:15 +0100)
15 files changed:
src/gallium/auxiliary/draw/draw_pipe.h
src/gallium/auxiliary/draw/draw_pipe_aaline.c
src/gallium/auxiliary/draw/draw_pipe_aapoint.c
src/gallium/auxiliary/draw/draw_pipe_clip.c
src/gallium/auxiliary/draw/draw_pipe_cull.c
src/gallium/auxiliary/draw/draw_pipe_flatshade.c
src/gallium/auxiliary/draw/draw_pipe_offset.c
src/gallium/auxiliary/draw/draw_pipe_pstipple.c
src/gallium/auxiliary/draw/draw_pipe_stipple.c
src/gallium/auxiliary/draw/draw_pipe_twoside.c
src/gallium/auxiliary/draw/draw_pipe_unfilled.c
src/gallium/auxiliary/draw/draw_pipe_validate.c
src/gallium/auxiliary/draw/draw_pipe_vbuf.c
src/gallium/auxiliary/draw/draw_pipe_wide_line.c
src/gallium/auxiliary/draw/draw_pipe_wide_point.c

index dbad8f98ac78b326871b98af088754603d071ce9..479250729ff7ac350a38d3c2e87056a7df033d29 100644 (file)
@@ -57,6 +57,7 @@ struct draw_stage
    struct draw_context *draw;   /**< parent context */
 
    struct draw_stage *next;     /**< next stage in pipeline */
+   const char *name;            /**< for debugging  */
 
    struct vertex_header **tmp;  /**< temp vert storage, such as for clipping */
    unsigned nr_tmps;
index ca69f0b95e5ff8ca8c4152b1f14cad206d3df1df..9fedeef2d34cff3ee4cd817075b4256b84fb4219 100644 (file)
@@ -746,6 +746,7 @@ draw_aaline_stage(struct draw_context *draw)
       goto fail;
 
    aaline->stage.draw = draw;
+   aaline->stage.name = "aaline";
    aaline->stage.next = NULL;
    aaline->stage.point = draw_pipe_passthrough_point;
    aaline->stage.line = aaline_first_line;
index 3133abe5dc7a688eec3947d98b226c9651e1696c..66839f7873ced1aa53eee3f221ead317259d5585 100644 (file)
@@ -757,6 +757,7 @@ draw_aapoint_stage(struct draw_context *draw)
       goto fail;
 
    aapoint->stage.draw = draw;
+   aapoint->stage.name = "aapoint";
    aapoint->stage.next = NULL;
    aapoint->stage.point = aapoint_first_point;
    aapoint->stage.line = draw_pipe_passthrough_line;
index 3265dcd154a90964ced2f5f48c2bf0c65a073d4e..0670268a196f2c6d933dfa32fb5654bafbc06ca2 100644 (file)
@@ -496,6 +496,7 @@ struct draw_stage *draw_clip_stage( struct draw_context *draw )
       goto fail;
 
    clipper->stage.draw = draw;
+   clipper->stage.name = "clipper";
    clipper->stage.point = clip_point;
    clipper->stage.line = clip_first_line;
    clipper->stage.tri = clip_first_tri;
index 053be5f050dec7d7d168ab634e77ac993af169a7..0a70483858cdff525e4b071ed7bdffb7d9982461 100644 (file)
@@ -129,6 +129,7 @@ struct draw_stage *draw_cull_stage( struct draw_context *draw )
       goto fail;
 
    cull->stage.draw = draw;
+   cull->stage.name = "cull";
    cull->stage.next = NULL;
    cull->stage.point = draw_pipe_passthrough_point;
    cull->stage.line = draw_pipe_passthrough_line;
index 43d1fecc4dd3d5a71468b1768d98f228ede0322c..34afb1a0b609bdb82a18fd6af9d269190bf6c0df 100644 (file)
@@ -261,6 +261,7 @@ struct draw_stage *draw_flatshade_stage( struct draw_context *draw )
       goto fail;
 
    flatshade->stage.draw = draw;
+   flatshade->stage.name = "flatshade";
    flatshade->stage.next = NULL;
    flatshade->stage.point = draw_pipe_passthrough_point;
    flatshade->stage.line = flatshade_first_line;
index 62c31532d01a0fe93c130d4643407cea92463df8..40798a5d6e7b394b25fe9eb2595067c83e040b77 100644 (file)
@@ -166,6 +166,7 @@ struct draw_stage *draw_offset_stage( struct draw_context *draw )
    draw_alloc_temp_verts( &offset->stage, 3 );
 
    offset->stage.draw = draw;
+   offset->stage.name = "offset";
    offset->stage.next = NULL;
    offset->stage.point = draw_pipe_passthrough_point;
    offset->stage.line = draw_pipe_passthrough_line;
index 04e59152c5c528dff8e12a051b354366dc804ea6..9287fc130eeabaf45a44b0cbb5c0c94dfd81f6aa 100644 (file)
@@ -586,6 +586,7 @@ draw_pstip_stage(struct draw_context *draw)
    draw_alloc_temp_verts( &pstip->stage, 8 );
 
    pstip->stage.draw = draw;
+   pstip->stage.name = "pstip";
    pstip->stage.next = NULL;
    pstip->stage.point = draw_pipe_passthrough_point;
    pstip->stage.line = draw_pipe_passthrough_line;
index b65e2aa10211beb748f946c82db5e6a682fbbd68..6e921bac27858f84ef01a055c7a2f2767bf32f56 100644 (file)
@@ -238,6 +238,7 @@ struct draw_stage *draw_stipple_stage( struct draw_context *draw )
    draw_alloc_temp_verts( &stipple->stage, 2 );
 
    stipple->stage.draw = draw;
+   stipple->stage.name = "stipple";
    stipple->stage.next = NULL;
    stipple->stage.point = stipple_reset_point;
    stipple->stage.line = stipple_first_line;
index c329d9233908e6f6c39fbfff26249f653dc73c69..eef0238b157f89392a72868ea893e633324d4cb0 100644 (file)
@@ -181,6 +181,7 @@ struct draw_stage *draw_twoside_stage( struct draw_context *draw )
       goto fail;
 
    twoside->stage.draw = draw;
+   twoside->stage.name = "twoside";
    twoside->stage.next = NULL;
    twoside->stage.point = draw_pipe_passthrough_point;
    twoside->stage.line = draw_pipe_passthrough_line;
index 68835fd1a592ac6eb2eb25e208b588467b36d2fd..03bb842e20a30c5978fe5fe899e9139e88829825 100644 (file)
@@ -184,6 +184,7 @@ struct draw_stage *draw_unfilled_stage( struct draw_context *draw )
       goto fail;
 
    unfilled->stage.draw = draw;
+   unfilled->stage.name = "unfilled";
    unfilled->stage.next = NULL;
    unfilled->stage.tmp = NULL;
    unfilled->stage.point = draw_pipe_passthrough_point;
index 03e842ce082bc49a663f46289a917bcf04575b94..bea90e50d30cd91eee9e00ff292e9806a908f182 100644 (file)
@@ -262,7 +262,15 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage )
 
    
    draw->pipeline.first = next;
-   return next;
+
+   if (0) {
+      debug_printf("draw pipeline:\n");
+      for (next = draw->pipeline.first; next ; next = next->next ) 
+         debug_printf("   %s\n", next->name);
+      debug_printf("\n");
+   }
+   
+   return draw->pipeline.first;
 }
 
 static void validate_tri( struct draw_stage *stage, 
@@ -318,6 +326,7 @@ struct draw_stage *draw_validate_stage( struct draw_context *draw )
       return NULL;
 
    stage->draw = draw;
+   stage->name = "validate";
    stage->next = NULL;
    stage->point = validate_point;
    stage->line = validate_line;
index 12325d30d61686ad595b2d35c49e57149d8c99cf..a5d840b96ea84562799aacdb69ebe25a06d0ec43 100644 (file)
@@ -446,6 +446,7 @@ struct draw_stage *draw_vbuf_stage( struct draw_context *draw,
       goto fail;
    
    vbuf->stage.draw = draw;
+   vbuf->stage.name = "vbuf";
    vbuf->stage.point = vbuf_first_point;
    vbuf->stage.line = vbuf_first_line;
    vbuf->stage.tri = vbuf_first_tri;
index 184e363594dce67034a7ff34a3a0232b38a9f1a9..f32cbef983d71aa70a2c9d9dcab0682cfe8d1bd5 100644 (file)
@@ -168,6 +168,7 @@ struct draw_stage *draw_wide_line_stage( struct draw_context *draw )
    draw_alloc_temp_verts( &wide->stage, 4 );
 
    wide->stage.draw = draw;
+   wide->stage.name = "wide-line";
    wide->stage.next = NULL;
    wide->stage.point = draw_pipe_passthrough_point;
    wide->stage.line = wideline_line;
index e1af9e56a24f0b10c41d8d878bfe31458a794745..49034ae86a2de3160e027e3400191f9f51850905 100644 (file)
@@ -279,6 +279,7 @@ struct draw_stage *draw_wide_point_stage( struct draw_context *draw )
       goto fail;
 
    wide->stage.draw = draw;
+   wide->stage.name = "wide-point";
    wide->stage.next = NULL;
    wide->stage.point = widepoint_first_point;
    wide->stage.line = draw_pipe_passthrough_line;