summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2013-04-27 21:56:18 +1200
committerChris Forbes <[email protected]>2013-04-30 07:16:02 +1200
commit251c87d8842c8a44d0c914c471356e487cd80031 (patch)
treeeecad996fc37fa38363043b91fc67335c56bb963
parent3cff41c7e438d86a95a78177db90e56fe1c63e0b (diff)
i965/vs: Fix Gen4/5 VUE map inconsistency with gl_ClipVertex
This is roughly a backport of Eric's commit 0967c362. We avoided assigning a slot in the VUE map for gl_ClipVertex, but left the bit set in outputs_written, producing horrible confusion further down the pipe. Mostly fixes rendering in source games, and probably in Freespace 2 SCP. No Piglit regressions on Ironlake. Signed-off-by: Chris Forbes <[email protected]> V2: Mask out the bit, not its index. Strangely, the game still worked with that wrong, but rendering of pretty much anything else was completely trashed. Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Tested-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 08104717781..0234ebb0ea8 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -62,9 +62,13 @@ brw_compute_vue_map(struct brw_context *brw, struct brw_vs_compile *c)
{
const struct intel_context *intel = &brw->intel;
struct brw_vue_map *vue_map = &c->prog_data.vue_map;
- GLbitfield64 outputs_written = c->prog_data.outputs_written;
+ GLbitfield64 outputs_written;
int i;
+ if (intel->gen < 6)
+ c->prog_data.outputs_written &= ~BITFIELD64_BIT(VERT_RESULT_CLIP_VERTEX);
+ outputs_written = c->prog_data.outputs_written;
+
vue_map->num_slots = 0;
for (i = 0; i < BRW_VERT_RESULT_MAX; ++i) {
vue_map->vert_result_to_slot[i] = -1;
@@ -150,8 +154,6 @@ brw_compute_vue_map(struct brw_context *brw, struct brw_vs_compile *c)
* feedback is enabled or disabled, just go ahead and assign a slot for it.
*/
for (int i = 0; i < VERT_RESULT_MAX; ++i) {
- if (intel->gen < 6 && i == VERT_RESULT_CLIP_VERTEX)
- continue;
if ((outputs_written & BITFIELD64_BIT(i)) &&
vue_map->vert_result_to_slot[i] == -1) {
assign_vue_slot(vue_map, i);