jay: Don't skip sampler payload copies for 2 or fewer sources

Sources may be the wrong file for a payload, and this is what copies
them to the correct one.

For example, a 1D shadow comparison may have a UGPR coordinate but
a GPR shadow comparator.  The UGPR needs to be splatted to a full
GPR because the sampler message is divergent.

Unnecessary copies should be easy to propagate away.

Fixes 366 tests in dEQP-VK.texture.shadow.1d.* and
dEQP-VK.pipeline.monolithic.sampler.view_type.1d.*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41808>
This commit is contained in:
Kenneth Graunke 2026-05-22 14:08:15 -07:00 committed by Marge Bot
parent cebc45af43
commit 35470e38ef

View file

@ -2124,11 +2124,9 @@ jay_emit_texture(struct nir_to_jay_state *nj, nir_tex_instr *tex)
desc_src = jay_AND_u32(b, desc_src, 0xfff);
}
if (n_sources > 2 || !jay_is_null(header)) {
for (unsigned i = 0; i < n_sources; ++i) {
payload[i] =
jay_src_as_strided(b, payload[i], 1, payload_uniform ? UGPR : GPR);
}
for (unsigned i = 0; i < n_sources; ++i) {
payload[i] =
jay_src_as_strided(b, payload[i], 1, payload_uniform ? UGPR : GPR);
}
enum jay_type src_type = jay_type(JAY_TYPE_U, payload_type_bit_size);