brw: fix split_sends with txf combining

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37527>
This commit is contained in:
Lionel Landwerlin 2025-09-08 10:12:47 +03:00 committed by Marge Bot
parent 6dbcc81c85
commit 73383fe7ef

View file

@ -366,18 +366,31 @@ brw_opt_split_sends(brw_shader &s)
lp->dst.nr != send->src[SEND_SRC_PAYLOAD1].nr)
continue;
/* Split either after the header (if present), or when consecutive
* sources switch from one VGRF to a different one.
*/
unsigned mid = lp->header_size;
if (mid == 0) {
for (mid = 1; mid < lp->sources; mid++) {
if (lp->src[mid].file == BAD_FILE)
continue;
/* SENDs gnerated generated by opt_txf_combiner look like this :
*
* load_payload(1) %222:D, -10d, -9d, -8d, -7d, -6d, -5d, -4d, -3d, -2d, -1d, 0d, 1d, 2d, 3d, 4d, 5d NoMask group0
* send(16) (mlen: 2) %223, 0u, 0u, %222, (null) NoMask group0 Desc 0x0005a001
*
* dEQP-VK.robustness.robustness2.bind.notemplate.r32i.unroll.nonvolatile.
* uniform_texel_buffer.no_fmt_qual.len_36.samples_1.1d.comp
*
* In that case just split in the middle, it doesn´t make sense to
* try to look at the LOAD_PAYLOAD sources to figure out where to
* split.
*/
if (lp->exec_size == 1) {
mid = lp->sources / 2;
} else {
for (mid = 1; mid < lp->sources; mid++) {
if (lp->src[mid].file == BAD_FILE)
continue;
if (lp->src[0].file != lp->src[mid].file ||
lp->src[0].nr != lp->src[mid].nr)
break;
if (lp->src[0].file != lp->src[mid].file ||
lp->src[0].nr != lp->src[mid].nr)
break;
}
}
}