summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/draw/draw_validate.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-01-28 15:50:02 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2008-01-28 15:50:02 +0000
commit82d9063708539d53c7670b2ab732bed24230b94d (patch)
tree668ee28b9fa45e5d87753ac26390c97d9c5900a4 /src/mesa/pipe/draw/draw_validate.c
parent88858e046888d0bcb763537adc74a64e564678df (diff)
gallium: handle flatshading explicitly in clipper stage
We can do a better job in the clip stage than just relying on the brute-force approach of copying colors to all incoming vertices applied in the flatshade stage. At very least, it is only necessary to do this in the clipper when a primitive is actually being clipped.
Diffstat (limited to 'src/mesa/pipe/draw/draw_validate.c')
-rw-r--r--src/mesa/pipe/draw/draw_validate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/pipe/draw/draw_validate.c b/src/mesa/pipe/draw/draw_validate.c
index 86d5a5f814..4375ebabbc 100644
--- a/src/mesa/pipe/draw/draw_validate.c
+++ b/src/mesa/pipe/draw/draw_validate.c
@@ -78,6 +78,11 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage )
precalc_flat = 1; /* only needed for triangles really */
need_det = 1;
}
+
+ if (draw->rasterizer->flatshade && precalc_flat) {
+ draw->pipeline.flatshade->next = next;
+ next = draw->pipeline.flatshade;
+ }
if (draw->rasterizer->offset_cw ||
draw->rasterizer->offset_ccw) {
@@ -110,13 +115,8 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage )
{
draw->pipeline.clip->next = next;
next = draw->pipeline.clip;
- precalc_flat = 1; /* XXX: FIX ME! Only needed for clipped prims */
}
- if (draw->rasterizer->flatshade && precalc_flat) {
- draw->pipeline.flatshade->next = next;
- next = draw->pipeline.flatshade;
- }
draw->pipeline.first = next;
return next;