summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Forbes <chrisf@ijw.co.nz>2013-07-07 23:13:07 +1200
committerChris Forbes <chrisf@ijw.co.nz>2013-08-02 05:48:02 +1200
commit4f26ea56120cffaa1a0c2337423cf08b835dffb8 (patch)
tree878c6aef78f25e5b96e587bdf1d787af06fddec8
parent4cedc45a1facc86b62e1dfd1a8693042f7200e21 (diff)
i965/vs: Gen4/5: enable front colors if back colors are written
Fixes undefined results if a back color is written, but the corresponding front color is not, and only backfacing primitives are drawn. Results are still undefined if a frontfacing primitive is drawn, but that's OK. The other reasonable way to fix this would have been to just pick the one color slot that was populated, but that dilutes the value of the tests. On Gen6+, the fixed function clipper and triangle setup already take care of this. Fixes 11 piglits: spec/glsl-1.10/execution/interpolation/interpolation-none-gl_Back*Color-* NOTE: This is a candidate for stable branches. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 1ec66f2fb2fea0497efebc1db83c75ec95a816a4)
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 0234ebb0ea8..950fca44b5d 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -271,6 +271,14 @@ do_vs_prog(struct brw_context *brw,
c.prog_data.outputs_written |= BITFIELD64_BIT(VERT_RESULT_TEX0 + i);
}
+ if (intel->gen < 6) {
+ /* if back colors are written, allocate slots for front colors too */
+ if (c.prog_data.outputs_written & BITFIELD64_BIT(VERT_RESULT_BFC0))
+ c.prog_data.outputs_written |= BITFIELD64_BIT(VERT_RESULT_COL0);
+ if (c.prog_data.outputs_written & BITFIELD64_BIT(VERT_RESULT_BFC1))
+ c.prog_data.outputs_written |= BITFIELD64_BIT(VERT_RESULT_COL1);
+ }
+
brw_compute_vue_map(brw, &c);
if (0) {