i965: write layer if gl_Layer is used in VS
authorJordan Justen <jordan.l.justen@intel.com>
Wed, 17 Apr 2013 23:17:50 +0000 (16:17 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Mon, 13 May 2013 20:57:57 +0000 (13:57 -0700)
This is enabled by the AMD_vertex_shader_layer extension.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index e5c1cece337d49c0560fda1ef023cab841dbc982..f14529af80f952e365c5caa5597db2116dfe13bb 100644 (file)
@@ -2597,6 +2597,10 @@ vec4_visitor::emit_psiz_and_flags(struct brw_reg reg)
          emit(MOV(brw_writemask(reg, WRITEMASK_W),
                   src_reg(output_reg[VARYING_SLOT_PSIZ])));
       }
+      if (prog_data->vue_map.slots_valid & VARYING_BIT_LAYER) {
+         emit(MOV(retype(brw_writemask(reg, WRITEMASK_Y), BRW_REGISTER_TYPE_D),
+                  src_reg(output_reg[VARYING_SLOT_LAYER])));
+      }
    }
 }