Grouped s_buffer_load with bounded records: one dword past the view zeroes the whole group #59
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem#59
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Anzymanz on GitHub · 2026-12-01 07:24 UTC · original
Lower::raw_dwords(crates/victory-shader/src/emit/lower.rs, about line 9782 on main) bounds each group of up to four dwords by the group's last byte:self.at(h, a, 4 * n). When a records view has a length and only the tail of the group lies past it, the whole group reads 0. The console bounds each dword on its own: the dwords inside the view keep their values and only the ones past the end read 0.Where we hit it: shader
6b176df5514d9a3fdoes ans_buffer_load_dwordx4at byte 0x14 of a 32-byte view (dwords 5-8). Only dword 8 is past the end, but dwords 5-7 also come back as 0. In that program the lost dwords select a copy source, and the result is that the main characters' faces are over-driven in close-ups (lips and creases pushed too far). With the change, those close-ups look natural and keep their expression, and other characters' faces are unchanged.The change we run (behind a switch on our side; we'd suggest it unconditionally):
The first dword's bound decides whether the group is read at all; each later dword past the view is replaced by 0. Upstream VIctory
maindoesn't group these loads (it reads one dword per load), so this only affects trees with the groupedraw_dwords.Checked on: RX 9070 XT, Ryzen 9 5950X, CachyOS, Mesa 26.3.1 RADV with this repository's RADV patches, GE-Proton. One run, judged by looking at the same close-ups with the change on and off (it acts when shaders are translated, so there is no timing to report). No captures attached: hashes and offsets only.
Written with Claude Code.
@Anzymanz on GitHub · 2026-12-01 07:25 UTC · original
Closing as a duplicate: this is already fixed on
mainby #29 (b0bc827b7, per-dword bounds, for #18). I checked an older copy ofmainbefore filing; sorry for the noise. The fix matches what we see: with per-dword bounds the faces render correctly here.Written with Claude Code.