aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_pipe_validate.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2014-12-10 20:07:25 +0100
committerRoland Scheidegger <[email protected]>2014-12-10 22:11:16 +0100
commit2b23149206c933aed473d289d79dd2f398f88389 (patch)
treede9e9769131167630fb20536f31285bb3e975f39 /src/gallium/auxiliary/draw/draw_pipe_validate.c
parentfb61f75bf633e60c0f81fe8ae59d03bfa68d755b (diff)
draw: fix flatshade stage for constant interpolated values
This stage only worked for traditional old-school flatshading, it did ignore constant interpolated values and only handled colors, the code probably predates using of constant interpolated values in gallium. So fix this - the clip stage apparently did this a long time ago already. Unfortunately this also means the stage needs to be invoked when flatshading isn't enabled but some other prim changing stages are - for instance with fill mode line each of the 3 lines in a tri should get the same attribute value from the leading vertex in the original tri if interpolation is constant, which did not happen before Due to that, the stage is now run in more cases, even unnecessary ones. Could in theory skip it completely if there aren't any constant interpolated attributes (and rast->flatshade isn't set), but not sure it's worth bothering, as it looks kinda complicated getting this information in advance. No piglit change (doesn't really cover this directly). Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_validate.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_validate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_validate.c b/src/gallium/auxiliary/draw/draw_pipe_validate.c
index 5c008c855ae..e69d84a37cd 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_validate.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_validate.c
@@ -221,7 +221,11 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage )
need_det = TRUE;
}
- if (rast->flatshade && precalc_flat) {
+ if (precalc_flat) {
+ /*
+ * could only run the stage if either rast->flatshade is true
+ * or there's constant interpolated values.
+ */
draw->pipeline.flatshade->next = next;
next = draw->pipeline.flatshade;
}