brw: handle layer_id only through system value

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39259>
This commit is contained in:
Lionel Landwerlin 2026-01-12 10:59:05 +02:00 committed by Marge Bot
parent b9a4f286ab
commit c3bd1a1688
2 changed files with 4 additions and 5 deletions

View file

@ -62,6 +62,7 @@ const struct nir_shader_compiler_options brw_scalar_nir_options = {
.lower_insert_byte = true,
.lower_insert_word = true,
.lower_isign = true,
.lower_layer_fs_input_to_sysval = true,
.lower_ldexp = true,
.lower_pack_half_2x16 = true,
.lower_pack_snorm_2x16 = true,

View file

@ -3981,16 +3981,14 @@ brw_from_nir_emit_fs_intrinsic(nir_to_brw_state &ntb,
*/
assert(instr->def.bit_size == 32);
unsigned base = nir_intrinsic_base(instr);
/* Handled with load_layer_id */
assert(base != VARYING_SLOT_LAYER);
unsigned comp = nir_intrinsic_component(instr);
unsigned num_components = instr->num_components;
/* TODO(mesh): Multiview. Verify and handle these special cases for Mesh. */
if (base == VARYING_SLOT_LAYER) {
dest.type = BRW_TYPE_UD;
bld.MOV(dest, fetch_render_target_array_index(bld));
break;
} else if (base == VARYING_SLOT_VIEWPORT) {
if (base == VARYING_SLOT_VIEWPORT) {
dest.type = BRW_TYPE_UD;
bld.MOV(dest, fetch_viewport_index(bld));
break;