nir/builder: Allow backend1/2 in nir_build_tex()

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
This commit is contained in:
Faith Ekstrand 2026-04-13 09:42:04 -04:00 committed by Marge Bot
parent 337aaa0ab9
commit e0fffabda7
2 changed files with 8 additions and 1 deletions

View file

@ -290,7 +290,8 @@ nir_build_tex_struct(nir_builder *build, nir_texop op, struct nir_tex_builder f)
}
const unsigned num_srcs = has_texture_src + has_sampler_src + !!f.coord +
!!f.ms_index + !!lod + !!f.bias + !!f.comparator;
!!f.ms_index + !!lod + !!f.bias +
!!f.comparator + !!f.backend1 + !!f.backend2;
nir_tex_instr *tex = nir_tex_instr_create(build->shader, num_srcs);
tex->op = op;
@ -384,6 +385,11 @@ nir_build_tex_struct(nir_builder *build, nir_texop op, struct nir_tex_builder f)
tex->src[i++] = nir_tex_src_for_ssa(nir_tex_src_comparator, f.comparator);
}
if (f.backend1)
tex->src[i++] = nir_tex_src_for_ssa(nir_tex_src_backend1, f.backend1);
if (f.backend2)
tex->src[i++] = nir_tex_src_for_ssa(nir_tex_src_backend2, f.backend2);
assert(i == num_srcs);
nir_def_init(&tex->instr, &tex->def, nir_tex_instr_dest_size(tex),

View file

@ -2196,6 +2196,7 @@ DEF_DERIV(ddy_coarse)
struct nir_tex_builder {
nir_def *coord, *ms_index, *lod, *bias, *comparator;
nir_def *backend1, *backend2;
unsigned texture_index, sampler_index;
nir_def *texture_offset, *sampler_offset;
nir_def *texture_heap_offset, *sampler_heap_offset;