aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-09-08 15:31:22 -0700
committerEric Anholt <[email protected]>2011-09-21 09:46:39 -0700
commitd158f6e73b0b7306f7bee246d2349c490041e449 (patch)
tree4d37dc9aef6f0791f29e1c7a5aa0e9db5256e4ef /src/mesa
parent447c488d77ea9710e0ffc238953917189d3000c7 (diff)
i965/gen6+: When only BFC is written, use BFC as the color.
Fixes piglit vertex-program-two-side enabled back back2
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_sf_state.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c
index bb8bc835d3d..4482e9cc09f 100644
--- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
@@ -67,6 +67,15 @@ get_attr_override(struct brw_vue_map *vue_map, int urb_entry_read_offset,
/* Find the VUE slot for this attribute. */
slot = vue_map->vert_result_to_slot[vs_attr];
+
+ /* If there was only a back color written but not front, use back
+ * as the color instead of undefined
+ */
+ if (slot == -1 && vs_attr == VERT_RESULT_COL0)
+ slot = vue_map->vert_result_to_slot[VERT_RESULT_BFC0];
+ if (slot == -1 && vs_attr == VERT_RESULT_COL1)
+ slot = vue_map->vert_result_to_slot[VERT_RESULT_BFC1];
+
if (slot == -1) {
/* This attribute does not exist in the VUE--that means that the vertex
* shader did not write to it. Behavior is undefined in this case, so