Trim unused trailing dwords from grouped scalar buffer reads #1188
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1191"
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?
Imported from fxceless/victory-fork. Originally posted by BradRoland on 2026-11-25T23:20:05Z.
With grouped scalar loads enabled, an
s_buffer_load_dwordx4at byte 328 can request 16 bytes even when the shader consumes only the first 12. This patch records the grouped reads produced by the scalar lowering and, after dead-code elimination, narrows each read through its last live component. A consumer of the fourth word, mapped status, or the whole result retains the original width. A gap between used components stays inside the mask.For the synthetic shader in #1179, Windows SDK disassembly shows one
rawBufferLoadwith mask7for the three-word case (previously15) and mask15for the four-word control. The scalar-mode outputs and the grouped four-word control have byte-identical DXIL before and after. All 24 dispatches over 336-, 340- and 344-byte views returned the expected words on an RTX 4080 and WARP. The shader library passed 217 tests with 3 ignored, and Clippy passed with all targets and features.The grouped-load switch stays opt-in. Run 277 reported black water with that switch enabled. This change reduces the access at the suspected boundary and gives testers a smaller change to try. Its effect on the game's water is still unverified. Run notes · Synthetic fixture and original disassembly
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.