summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2014-04-11 10:55:38 -0700
committerAnuj Phogat <[email protected]>2014-04-17 10:08:28 -0700
commit7928b9c249b2059c926d58a30f9f38bceafefb77 (patch)
tree3660b5cb7395bd20b873515e7157e74deca65c44 /src/mesa/drivers
parent969b461c2b28efbf44ea02cd09c8c6593f4c7343 (diff)
i965: Fix component mask and varying_to_slot mapping for gl_Layer
gl_Layer doesn't get its own varying slot. It is stored in VARYING_SLOT_PSIZ.y. This patch fixes the issue for both gen7 and gen8 because gen7_upload_3dstate_so_decl_list() is shared between them. Fixes failures in OpenGL Khronos CTS test transform_feedback_builtins. Makes new piglit test glsl-1.50-transform-feedback-builtins pass for 'gl_Layer'. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/gen7_sol_state.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/gen7_sol_state.c b/src/mesa/drivers/dri/i965/gen7_sol_state.c
index 06a4cdf36c9..3623238d3f6 100644
--- a/src/mesa/drivers/dri/i965/gen7_sol_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c
@@ -121,10 +121,15 @@ gen7_upload_3dstate_so_decl_list(struct brw_context *brw,
const unsigned components = linked_xfb_info->Outputs[i].NumComponents;
unsigned component_mask = (1 << components) - 1;
- /* gl_PointSize is stored in VARYING_SLOT_PSIZ.w. */
+ /* gl_PointSize is stored in VARYING_SLOT_PSIZ.w
+ * gl_Layer is stored in VARYING_SLOT_PSIZ.y
+ */
if (varying == VARYING_SLOT_PSIZ) {
assert(components == 1);
component_mask <<= 3;
+ } else if (varying == VARYING_SLOT_LAYER) {
+ assert(components == 1);
+ component_mask <<= 1;
} else {
component_mask <<= linked_xfb_info->Outputs[i].ComponentOffset;
}
@@ -132,9 +137,14 @@ gen7_upload_3dstate_so_decl_list(struct brw_context *brw,
buffer_mask |= 1 << buffer;
decl |= buffer << SO_DECL_OUTPUT_BUFFER_SLOT_SHIFT;
- assert(vue_map->varying_to_slot[varying] >= 0);
- decl |= vue_map->varying_to_slot[varying] <<
- SO_DECL_REGISTER_INDEX_SHIFT;
+ if (varying == VARYING_SLOT_LAYER) {
+ decl |= vue_map->varying_to_slot[VARYING_SLOT_PSIZ] <<
+ SO_DECL_REGISTER_INDEX_SHIFT;
+ } else {
+ assert(vue_map->varying_to_slot[varying] >= 0);
+ decl |= vue_map->varying_to_slot[varying] <<
+ SO_DECL_REGISTER_INDEX_SHIFT;
+ }
decl |= component_mask << SO_DECL_COMPONENT_MASK_SHIFT;
/* Mesa doesn't store entries for gl_SkipComponents in the Outputs[]