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>
(cherry picked from commit 1e59dbf66b)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
This commit is contained in:
Dave Airlie 2026-01-09 14:14:53 +10:00 committed by Dylan Baker
parent 2556e10273
commit 043544961c
2 changed files with 7 additions and 7 deletions

View file

@ -474,7 +474,7 @@
"description": "gallivm: swap 1d array coords before casting.",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -5527,6 +5527,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:
@ -5546,12 +5552,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);