shader: lower image stores of fewer than four channels #94
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!94
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-94"
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?
@Olima34 on GitHub · 2026-11-26 14:29 UTC · original
Olima34:fix/shader-image-store-dmask→main· +163 −8 · 4 files · 4 commits · merged 2026-11-26 17:05 UTCWhat this changes
image_storewith admaskother than0xFwas refused ("an image store of some channels"). As for typed buffer stores (#56), GFX11 and older store 0 in the channels the mask leaves out (LLVM 88421ea "[AMDGPU] Trim zero components from buffer and image stores", Mesa 4a6ee2c4833), so the store now writes the whole texel: the data holds the enabled channels in turn (two per VGPR withd16), and the others are 0. Admaskof 0, whose behaviour is undocumented, is still refused. docs/native-host.md gets the image counterpart of the "Typed buffer stores" note.Tests: hand-assembled stores with
dmask0x1, 0x3 and 0x5 now translate (image_stores_of_some_channels_lower), and a Windows value test reads the UAV back (image_stores_of_some_channels_zero_the_others).How it was tested
cargo test -p victory-shaderand arm64cargo test --workspace(value probes run only in the Windows CI)cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings, also with--all-featurescargo xtask policyChecklist
VICTORY_*variable and documented (none added)image_store with a dmask other than 0xF was refused ("an image store of some channels"). On GFX11 and older the hardware stores 0 in the channels dmask leaves out (LLVM 88421ea "[AMDGPU] Trim zero components from buffer and image stores"; Mesa 4a6ee2c4833 "aco: shrink buffer stores with undef/zero components"), as it does for typed buffer stores (#56). The data VGPRs hold the enabled channels in turn (two per VGPR with d16), the others are stored as 0 and the DXIL write mask stays 0xF. A dmask of 0, whose effect is not documented, stays refused. Tests: a translation test (dmask 0x1, 0x3, 0x5, 0xE, 0xF and d16 0x5; dmask 0 refused) that fails without the change, through the typed store helper generalised to an 8-dword descriptor, and a Windows UAV readback (each row stored whole, then with dmask 0x1, 0x3, 0x5, 0xE or 0x8).@LakshanSivakumar on GitHub · 2026-11-26 14:54 UTC · original · requested changes
Thanks, this is the image-store version we'll keep. One thing: docs/native-host.md says "This is not a guess", but the LLVM/Mesa evidence only shows zero-fill of missing trailing components. Please narrow that to prefix dmasks and mark gapped masks (e.g. 0x5) as a guess.
@Olima34 on GitHub · 2026-11-26 15:01 UTC · original
Done: the docs and the code comment now call prefix dmasks (0x1, 0x3, 0x7) established, by the zero-fill of missing trailing components in LLVM 88421ea and Mesa 4a6ee2c4833, and mark gapped masks (0x5, or one without red) as a guess. No code change.
@LakshanSivakumar on GitHub · 2026-11-26 16:03 UTC · original · review (dismissed)
The prefix dmasks are now documented as established and gapped masks as a guess, in the docs and the code comment. CI is green. Approving.