i965/fs: Implement load_layer_id for fragment shaders
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 15 Nov 2016 23:18:32 +0000 (15:18 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 22 Nov 2016 21:03:31 +0000 (13:03 -0800)
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index 82e22c27310b1e71bf95e67df24b8db46d0fb82e..c88fa77472cba1a4331b7355efaf166b7d29ed88 100644 (file)
@@ -3259,6 +3259,11 @@ fs_visitor::nir_emit_fs_intrinsic(const fs_builder &bld,
       break;
    }
 
+   case nir_intrinsic_load_layer_id:
+      dest.type = BRW_REGISTER_TYPE_UD;
+      bld.MOV(dest, fetch_render_target_array_index(bld));
+      break;
+
    case nir_intrinsic_load_helper_invocation:
    case nir_intrinsic_load_sample_mask_in:
    case nir_intrinsic_load_sample_id: {