Shaders: buffer byte and half stores of a VGPR's high half (_d16_hi) #2333
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2333
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2333"
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?
@TinkerBell-90 on GitHub · 2026-11-25 10:50 UTC · original
TinkerBell-90:shaders-buffer-store-d16-hi→main· +81 −3 · 2 files · 1 commits · openbuffer_store_byte_d16_hiandbuffer_store_short_d16_hiwere refused by name, so a program using one did not translate. They now store bits 16-23 or 16-31 of their VGPR, through the same two atomics on the dword asbuffer_store_byteandbuffer_store_short(and the same limits: no store by index, the field does not cross a dword).Claimed in #1633: #1633
Test:
stride_tests::high_half_buffer_stores_take_the_vgprs_high_half. 32 lanes store a half and a byte from the high half of a VGPR whose low half is junk, two or four lanes per dword.Run here: Linux, tests built for
x86_64-pc-windows-gnuand run under Wine + vkd3d-proton on an RTX 3070. There is no WARP in this setup, so both loops of the test run on the card.Unsupported { what: "buffer_store_short_d16_hi" }) and when the field is taken from bit 0 (the junk lands).940d32fon the same host: 242 passed and the same 5 failures (the three hardware conversion and fusing checks,a_heap_buffer_read_where_no_buffer_view_is_reads_zeros,stub_pipeline_is_created).cargo test -p victory-shader --libon Linux: 144 passed. Clippy for windows-msvc with-D warnings: clean. rustfmt: no new differences.cargo xtask policy: ok.Not tested with the game. #2003 adds the
_d16loads and #2208 changes how the plain byte and half stores write; this touches the same lines ofbuffer()but not the same cases.AI-assisted.
@steven-seagull27 on GitHub · 2026-11-25 11:06 UTC · original
Confirmed on native Windows D3D12 at
6d0f5f9with an RTX 5080 and built-in Microsoft WARP, in separate processes. Both adapters passed the PR's packed test: all 32 halfwords and 32 bytes matched, and all eight trailing dwords stayed zero.I also split the two instructions and prefilled the UAV with
0xab897654to check the neighboring fields. On each adapter, the high-half byte store matched 128/128 dwords across byte positions 0–3, and the high-half short store matched 64/64 dwords across byte positions 0 and 2. For example, lane 5 stored0x45at byte position 1 and read back0xab894554, preserving all three neighboring bytes.On the exact parent
940d32f, the isolated cases each stopped during lowering with the corresponding unsupported opcode, before dispatch. The ordinary byte and short store controls returned 64/64 correct dwords per adapter on both revisions. These were synthetic 32-thread compute dispatches. Both device identities were checked, including the loaded system WARP DLL.@Marvisak on GitHub · 2026-11-25 15:23 UTC · original
Automated triage for the maintainers.
Merge candidate (worth a look). This adds
buffer_store_byte_d16_hiandbuffer_store_short_d16_hitoLower::bufferinlower.rs, through the existing byte/half store path (two atomics on the dword) with the data shifted right by 16 first. That matches the RDNA2 ISA, where these opcodes store bits 23:16 and 31:16 of the VGPR. I decoded the test's MUBUF words by hand (opcodes 0x1B and 0x19, matchinggfx10/opcodes.rs; vaddr, vdata, srsrc and offset fields right) and the expected buffer contents match. Another contributor reports the test passing on native RTX and on WARP with neighbouring bytes preserved. It touches the same lines as #2003 and #2208, but not the same cases. CI: passing.Generated by Claude Code
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.