libagx: fix prefix sum kernel

the calculation of workgroup reductions was wrong, giving nondeterministic
results when prefix summing >= 1024 items. fixes misrendering in
terraintessellation on honeykrisp.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30382>
This commit is contained in:
Alyssa Rosenzweig
2024-07-16 18:10:52 -04:00
committed by Marge Bot
parent bdbd81ea40
commit f6e9e7d3ce

View File

@@ -587,7 +587,7 @@ libagx_work_group_scan_inclusive_add(uint x, local uint *scratch)
uint prefix = base + sg;
/* Reduce the workgroup using the prefix sum we already did */
uint reduction = sub_group_broadcast(other_sums, 31) + other_sum;
uint reduction = sub_group_broadcast(other_sums + other_sum, 31);
return (uint2)(prefix, reduction);
}