gallivm: swap 1d array coords before casting.

This fixes a llvm validation error seen in dEQP-VK.robustness.robustness2.push.notemplate.rgba32f.dontunroll.nonvolatile.sampled_image.no_fmt_qual.img.samples_1.1d_array.rgen

Cc: mesa-stable
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39225>
This commit is contained in:
Dave Airlie 2026-01-09 14:14:53 +10:00 committed by Marge Bot
parent 7bbbd9bee2
commit 1e59dbf66b

View file

@ -5535,6 +5535,12 @@ visit_tex(struct lp_build_nir_soa_context *bld, nir_tex_instr *instr)
if (!sampler_resource)
sampler_resource = texture_resource;
if (instr->is_array && instr->sampler_dim == GLSL_SAMPLER_DIM_1D) {
/* move layer coord for 1d arrays. */
coords[2] = coords[1];
coords[1] = coord_zero;
}
switch (instr->op) {
case nir_texop_tex:
case nir_texop_tg4:
@ -5554,12 +5560,6 @@ visit_tex(struct lp_build_nir_soa_context *bld, nir_tex_instr *instr)
;
}
if (instr->is_array && instr->sampler_dim == GLSL_SAMPLER_DIM_1D) {
/* move layer coord for 1d arrays. */
coords[2] = coords[1];
coords[1] = coord_zero;
}
uint32_t samp_base_index = 0, tex_base_index = 0;
if (!sampler_deref_instr) {
int samp_src_index = nir_tex_instr_src_index(instr, nir_tex_src_sampler_handle);