diff options
author | Brian <[email protected]> | 2008-01-25 15:59:27 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2008-01-25 17:22:56 -0700 |
commit | 0bfd085e2866fbbd40209dcee23f0e6240583fe8 (patch) | |
tree | 5cefec02084d42517848529161b734d73557059a /src/mesa/pipe/draw/draw_cull.c | |
parent | bd8bf60b6f2402895e7159a4df644f8a4a307cf5 (diff) |
gallium: replace prim pipeline begin/end() functions with flush()
This is basically half of Keith's draw/flush patch.
The stage->point/line/tri() functions are now self-validating, the validator
functions are installed by the flush() function.
There were excessive calls to validate_pipeline(), however. This was caused
by draw_prim_queue_flush() keeping a local 'first' variable that always pointed
to the validate functions. Replaced 'first' with 'draw->pipeline.first'.
Performance in gears is up just slightly with this patch.
Diffstat (limited to 'src/mesa/pipe/draw/draw_cull.c')
-rw-r--r-- | src/mesa/pipe/draw/draw_cull.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/mesa/pipe/draw/draw_cull.c b/src/mesa/pipe/draw/draw_cull.c index 9bd53f45f26..05c274e4dc2 100644 --- a/src/mesa/pipe/draw/draw_cull.c +++ b/src/mesa/pipe/draw/draw_cull.c @@ -50,14 +50,6 @@ static INLINE struct cull_stage *cull_stage( struct draw_stage *stage ) } -static void cull_begin( struct draw_stage *stage ) -{ - struct cull_stage *cull = cull_stage(stage); - - cull->winding = stage->draw->rasterizer->cull_mode; - - stage->next->begin( stage->next ); -} static void cull_tri( struct draw_stage *stage, @@ -90,6 +82,18 @@ static void cull_tri( struct draw_stage *stage, } } +static void cull_first_tri( struct draw_stage *stage, + struct prim_header *header ) +{ + struct cull_stage *cull = cull_stage(stage); + + cull->winding = stage->draw->rasterizer->cull_mode; + + stage->tri = cull_tri; + stage->tri( stage, header ); +} + + static void cull_line( struct draw_stage *stage, struct prim_header *header ) @@ -105,12 +109,12 @@ static void cull_point( struct draw_stage *stage, } -static void cull_end( struct draw_stage *stage ) +static void cull_flush( struct draw_stage *stage, unsigned flags ) { - stage->next->end( stage->next ); + stage->tri = cull_first_tri; + stage->next->flush( stage->next, flags ); } - static void cull_reset_stipple_counter( struct draw_stage *stage ) { stage->next->reset_stipple_counter( stage->next ); @@ -135,11 +139,10 @@ struct draw_stage *draw_cull_stage( struct draw_context *draw ) cull->stage.draw = draw; cull->stage.next = NULL; - cull->stage.begin = cull_begin; cull->stage.point = cull_point; cull->stage.line = cull_line; - cull->stage.tri = cull_tri; - cull->stage.end = cull_end; + cull->stage.tri = cull_first_tri; + cull->stage.flush = cull_flush; cull->stage.reset_stipple_counter = cull_reset_stipple_counter; cull->stage.destroy = cull_destroy; |