Mesa (master): gallium/draw: add ability to print out active pipeline stages

Keith Whitwell keithw at kemper.freedesktop.org
Tue Apr 28 10:17:40 PDT 2009


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

Author: Keith Whitwell <keithw at vmware.com>
Date:   Tue Apr 28 14:50:05 2009 +0100

gallium/draw: add ability to print out active pipeline stages

---

 src/gallium/auxiliary/draw/draw_pipe.h            |    1 +
 src/gallium/auxiliary/draw/draw_pipe_aaline.c     |    1 +
 src/gallium/auxiliary/draw/draw_pipe_aapoint.c    |    1 +
 src/gallium/auxiliary/draw/draw_pipe_clip.c       |    1 +
 src/gallium/auxiliary/draw/draw_pipe_cull.c       |    1 +
 src/gallium/auxiliary/draw/draw_pipe_flatshade.c  |    1 +
 src/gallium/auxiliary/draw/draw_pipe_offset.c     |    1 +
 src/gallium/auxiliary/draw/draw_pipe_pstipple.c   |    1 +
 src/gallium/auxiliary/draw/draw_pipe_stipple.c    |    1 +
 src/gallium/auxiliary/draw/draw_pipe_twoside.c    |    1 +
 src/gallium/auxiliary/draw/draw_pipe_unfilled.c   |    1 +
 src/gallium/auxiliary/draw/draw_pipe_validate.c   |   11 ++++++++++-
 src/gallium/auxiliary/draw/draw_pipe_vbuf.c       |    1 +
 src/gallium/auxiliary/draw/draw_pipe_wide_line.c  |    1 +
 src/gallium/auxiliary/draw/draw_pipe_wide_point.c |    1 +
 15 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pipe.h b/src/gallium/auxiliary/draw/draw_pipe.h
index dbad8f9..4792507 100644
--- a/src/gallium/auxiliary/draw/draw_pipe.h
+++ b/src/gallium/auxiliary/draw/draw_pipe.h
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index ca69f0b..9fedeef 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
index 3133abe..66839f7 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_clip.c b/src/gallium/auxiliary/draw/draw_pipe_clip.c
index 3265dcd..0670268 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_clip.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_clip.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_cull.c b/src/gallium/auxiliary/draw/draw_pipe_cull.c
index 053be5f..0a70483 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_cull.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_cull.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_flatshade.c b/src/gallium/auxiliary/draw/draw_pipe_flatshade.c
index 43d1fec..34afb1a 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_flatshade.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_flatshade.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_offset.c b/src/gallium/auxiliary/draw/draw_pipe_offset.c
index 62c3153..40798a5 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_offset.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_offset.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
index 04e5915..9287fc1 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_stipple.c b/src/gallium/auxiliary/draw/draw_pipe_stipple.c
index b65e2aa..6e921ba 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_stipple.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_stipple.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_twoside.c b/src/gallium/auxiliary/draw/draw_pipe_twoside.c
index c329d92..eef0238 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_twoside.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_twoside.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_unfilled.c b/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
index 68835fd..03bb842 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_validate.c b/src/gallium/auxiliary/draw/draw_pipe_validate.c
index 03e842c..bea90e5 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_validate.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_validate.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
index 12325d3..a5d840b 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_wide_line.c b/src/gallium/auxiliary/draw/draw_pipe_wide_line.c
index 184e363..f32cbef 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_wide_line.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_wide_line.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
index e1af9e5..49034ae 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
@@ -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;



More information about the mesa-commit mailing list