summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/draw/draw_offset.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-25 15:59:27 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-25 17:22:56 -0700
commit0bfd085e2866fbbd40209dcee23f0e6240583fe8 (patch)
tree5cefec02084d42517848529161b734d73557059a /src/mesa/pipe/draw/draw_offset.c
parentbd8bf60b6f2402895e7159a4df644f8a4a307cf5 (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_offset.c')
-rw-r--r--src/mesa/pipe/draw/draw_offset.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/mesa/pipe/draw/draw_offset.c b/src/mesa/pipe/draw/draw_offset.c
index f8a01db3dd..a2990ee8a8 100644
--- a/src/mesa/pipe/draw/draw_offset.c
+++ b/src/mesa/pipe/draw/draw_offset.c
@@ -52,16 +52,7 @@ static INLINE struct offset_stage *offset_stage( struct draw_stage *stage )
}
-static void offset_begin( struct draw_stage *stage )
-{
- struct offset_stage *offset = offset_stage(stage);
- float mrd = 1.0f / 65535.0f; /* XXX this depends on depthbuffer bits! */
- offset->units = stage->draw->rasterizer->offset_units * mrd;
- offset->scale = stage->draw->rasterizer->offset_scale;
-
- stage->next->begin( stage->next );
-}
/**
@@ -124,24 +115,39 @@ static void offset_tri( struct draw_stage *stage,
}
+static void offset_first_tri( struct draw_stage *stage,
+ struct prim_header *header )
+{
+ struct offset_stage *offset = offset_stage(stage);
+ float mrd = 1.0f / 65535.0f; /* XXX this depends on depthbuffer bits! */
+
+ offset->units = stage->draw->rasterizer->offset_units * mrd;
+ offset->scale = stage->draw->rasterizer->offset_scale;
+
+ stage->tri = offset_tri;
+ stage->tri( stage, header );
+}
+
static void offset_line( struct draw_stage *stage,
- struct prim_header *header )
+ struct prim_header *header )
{
stage->next->line( stage->next, header );
}
static void offset_point( struct draw_stage *stage,
- struct prim_header *header )
+ struct prim_header *header )
{
stage->next->point( stage->next, header );
}
-static void offset_end( struct draw_stage *stage )
+static void offset_flush( struct draw_stage *stage,
+ unsigned flags )
{
- stage->next->end( stage->next );
+ stage->tri = offset_first_tri;
+ stage->next->flush( stage->next, flags );
}
@@ -169,11 +175,10 @@ struct draw_stage *draw_offset_stage( struct draw_context *draw )
offset->stage.draw = draw;
offset->stage.next = NULL;
- offset->stage.begin = offset_begin;
offset->stage.point = offset_point;
offset->stage.line = offset_line;
- offset->stage.tri = offset_tri;
- offset->stage.end = offset_end;
+ offset->stage.tri = offset_first_tri;
+ offset->stage.flush = offset_flush;
offset->stage.reset_stipple_counter = offset_reset_stipple_counter;
offset->stage.destroy = offset_destroy;