summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2013-11-05 12:19:23 -0800
committerIan Romanick <[email protected]>2014-01-20 11:32:01 -0800
commitfceb8b55c078b07e71f862ac135c2c339ef53e98 (patch)
tree6b60f637421a83530c97cc866549cc4fa1af36e7
parent37f65b07512c0291580811689f65bfcbcc489231 (diff)
i965: Emit writes to viewport index
This variable is handled in a fashion identical to gl_Layer. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 3b8cef69a7e..f6dc3a8f155 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2772,6 +2772,10 @@ vec4_visitor::emit_psiz_and_flags(struct brw_reg reg)
emit(MOV(retype(brw_writemask(reg, WRITEMASK_Y), BRW_REGISTER_TYPE_D),
src_reg(output_reg[VARYING_SLOT_LAYER])));
}
+ if (prog_data->vue_map.slots_valid & VARYING_BIT_VIEWPORT) {
+ emit(MOV(retype(brw_writemask(reg, WRITEMASK_Z), BRW_REGISTER_TYPE_D),
+ src_reg(output_reg[VARYING_SLOT_VIEWPORT])));
+ }
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 3c1cfa41075..0e9470fe0a3 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -60,10 +60,10 @@ brw_compute_vue_map(struct brw_context *brw, struct brw_vue_map *vue_map,
vue_map->slots_valid = slots_valid;
int i;
- /* gl_Layer doesn't get its own varying slot--it's stored in the virst VUE
- * slot (VARYING_SLOT_PSIZ).
+ /* gl_Layer and gl_ViewportIndex don't get their own varying slots -- they
+ * are stored in the virst VUE slot (VARYING_SLOT_PSIZ).
*/
- slots_valid &= ~VARYING_BIT_LAYER;
+ slots_valid &= ~(VARYING_BIT_LAYER | VARYING_BIT_VIEWPORT);
/* Make sure that the values we store in vue_map->varying_to_slot and
* vue_map->slot_to_varying won't overflow the signed chars that are used