r600/sfn: use only as many components as needed for tex backend coord

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>
This commit is contained in:
Gert Wollny
2022-11-30 18:54:00 +01:00
committed by Marge Bot
parent bcd9da1b38
commit 1975d5eaf4
@@ -1162,14 +1162,16 @@ LowerTexToBackend::finalize(nir_tex_instr *tex,
nir_ssa_def *
LowerTexToBackend::prep_src(std::array<nir_ssa_def *, 4>& coord, int& used_coord_mask)
{
int max_coord = 0;
for (int i = 0; i < 4; ++i) {
if (coord[i])
if (coord[i]) {
used_coord_mask |= 1 << i;
else
max_coord = i;
} else
coord[i] = get_undef();
}
return nir_vec(b, coord.data(), 4);
return nir_vec(b, coord.data(), max_coord + 1);
}
nir_ssa_def *