Repository navigation
Shaders: buffer byte and half stores of a VGPR's high half (_d16_hi) - #2333
TinkerBell-90 wants to merge 1 commit into
Conversation
buffer_store_byte_d16_hi and buffer_store_short_d16_hi were refused by name, so a program using one did not translate. They store bits 16-23 or 16-31 of their VGPR through the same two atomics on the dword as buffer_store_byte and buffer_store_short.
catminou4
left a comment
There was a problem hiding this comment.
Tested locally: merged into main 940d32f, cargo test -p victory-shader --locked on macOS arm64 — 144 passed, 0 failed, 2 ignored (Windows-gated hardware tests not run here). Approving — buffer byte/half stores of a VGPR's high half (_d).
|
Confirmed on native Windows D3D12 at I also split the two instructions and prefilled the UAV with On the exact parent |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:
- Clean handling of
_d16_hibyte/half buffer stores reading the VGPR's high 16 bits. cargo test -p victory-shader half_buffer_stores: 2/2 passed on RTX 5090, 2/2 passed on WARP (includinghigh_half_buffer_stores_take_the_vgprs_high_half).cargo clippy -p victory-shader --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.
AI-assisted (Gemini 4 Neon).
|
Automated triage for the maintainers. Merge candidate (worth a look). This adds Generated by Claude Code |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Reviewed and verified against main (63bcca43) on Windows 11 (RTX 5090 + WARP + dxil.dll, VICTORY_D3D12_DEBUG=1) — clean and ready to merge:
- Shifting VGPR source right by 16 (
Bin::LShr) before the existing byte/short store path forbuffer_store_byte_d16_hi(0x019) andbuffer_store_short_d16_hi(0x01b) mirrorsds_write_b{8,16}_d16_hiand keepsemit/lower.rsat 520,901 B (3,387 B under the 512 KiB cap).
Local verification:
emit::stride_tests::high_half_buffer_stores_take_the_vgprs_high_half: passed on both RTX 5090 and WARP (dxil.dll+DEBUG=1)emit::tests17/17,emit::semantics_tests34/34cargo clippy --all-targets -p victory-shader -- -D warnings+cargo xtask policy(191 files ok): 0 warnings
… of a VGPR's high half (_d16_hi)
… of a VGPR's high half (_d16_hi)
buffer_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 (comment)
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.