From c3bd1a16885ce8638e0be0b452fbe2d02fcccda2 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 12 Jan 2026 10:59:05 +0200 Subject: [PATCH] brw: handle layer_id only through system value Signed-off-by: Lionel Landwerlin Reviewed-by: Alyssa Rosenzweig Part-of: --- src/intel/compiler/brw/brw_compiler.c | 1 + src/intel/compiler/brw/brw_from_nir.cpp | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/intel/compiler/brw/brw_compiler.c b/src/intel/compiler/brw/brw_compiler.c index 84733ba2073..a1d7e994c79 100644 --- a/src/intel/compiler/brw/brw_compiler.c +++ b/src/intel/compiler/brw/brw_compiler.c @@ -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, diff --git a/src/intel/compiler/brw/brw_from_nir.cpp b/src/intel/compiler/brw/brw_from_nir.cpp index 19ad2618a04..c3a564142f7 100644 --- a/src/intel/compiler/brw/brw_from_nir.cpp +++ b/src/intel/compiler/brw/brw_from_nir.cpp @@ -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;