brw/nir_lower_fs_load_output: unify texture builders

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39271>
This commit is contained in:
Alyssa Rosenzweig 2026-01-12 12:21:59 -05:00 committed by Marge Bot
parent 41cdc548ee
commit c339b55f92

View file

@ -49,22 +49,15 @@ brw_nir_lower_fs_load_output_instr(nir_builder *b,
nir_def *coord = nir_vec(b, coords, 3);
nir_def *tex =
key->multisample_fbo == INTEL_NEVER ?
nir_build_tex(b, nir_texop_txf, coord,
.texture_index = target,
.dim = GLSL_SAMPLER_DIM_2D,
.is_array = true,
.dest_type = nir_type_uint32) :
nir_build_tex(b, nir_texop_txf_ms, coord,
.texture_index = target,
.dim = GLSL_SAMPLER_DIM_MS,
.is_array = true,
.ms_index = nir_load_sample_id(b),
.dest_type = nir_type_uint32);
bool msaa = key->multisample_fbo != INTEL_NEVER;
nir_def *tex = nir_txf(b, coord,
.texture_index = target,
.ms_index = msaa ? nir_load_sample_id(b) : NULL,
.dim = msaa ? GLSL_SAMPLER_DIM_MS : GLSL_SAMPLER_DIM_2D,
.is_array = true,
.dest_type = nir_type_uint32);
nir_def_replace(&intrin->def, tex);
return true;
}