shader: lower an image store that writes only some channels #88

Closed
github-bot wants to merge 1 commit from github-bot/gh-88 into main AGit
Owner

@⁠AeroUp on GitHub · 2026-11-26 14:00 UTC · original
AeroUp:fix/shader-image-packs → main · +155 −13 · 4 files · 1 commits · closed without merging

A compute store whose dmask leaves channels out was refused (an image store of some channels is not supported) or wrote only the first channel. This lowers it: the enabled channels are read from the consecutive data registers and placed at their component index, dx.op.textureStore receives the real mask so the channels it leaves out keep their value, the d16 form packs two f16 channels per register keyed by enabled channel, and dmask 0 writes nothing.

In this game's world load, ~40 of the compute shaders hit this refusal (the largest group after the FSPX ones).

Hand-assembled GFX10 fixtures cover dmask 0x5 (R+B), its d16 form, and 0; cargo test -p victory-shader is 227 passed, 0 failed.

Not duplicated here: typed buffer stores of some channels/at an offset are #56 (merged), and s_pack_*/s_bitreplicate_b64_b32 are #84 (open). Those two I had also written before noticing; only the image-store rule is in this PR.

**@⁠AeroUp** on GitHub · 2026-11-26 14:00 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/88) `AeroUp:fix/shader-image-packs` → `main` · +155 −13 · 4 files · 1 commits · closed without merging A compute store whose `dmask` leaves channels out was refused (`an image store of some channels is not supported`) or wrote only the first channel. This lowers it: the enabled channels are read from the consecutive data registers and placed at their component index, `dx.op.textureStore` receives the real mask so the channels it leaves out keep their value, the `d16` form packs two f16 channels per register keyed by enabled channel, and `dmask 0` writes nothing. In this game's world load, ~40 of the compute shaders hit this refusal (the largest group after the FSPX ones). Hand-assembled GFX10 fixtures cover `dmask 0x5` (R+B), its d16 form, and 0; `cargo test -p victory-shader` is 227 passed, 0 failed. Not duplicated here: typed buffer stores of some channels/at an offset are #56 (merged), and `s_pack_*`/`s_bitreplicate_b64_b32` are #84 (open). Those two I had also written before noticing; only the image-store rule is in this PR.
A store whose dmask leaves channels out wrote nothing (or only the first channel)
and was refused as "an image store of some channels". The store now walks the
enabled channels, reads the consecutive data registers and places each value at
its component index; dx.op.textureStore receives the real mask, so channels the
mask leaves out keep their value. The d16 form packs two f16 channels per
register keyed by enabled channel, and a dmask of 0 writes nothing.

Hand-assembled GFX10 fixtures: dmask 0x5 (R+B), its d16 form, and 0.
cargo test -p victory-shader: 227 passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:45:40 +00:00
github-bot closed this pull request 2026-11-26 15:00:25 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 14:55 UTC · original

Thanks for this, and for the world-load numbers. #94 covers the same refusal and keeps the full-texel write the typed-buffer-store path uses (a raw gapped dmask isn't a valid DXIL store mask), so we're landing that one. Closing as a duplicate.

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 14:55 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/88#issuecomment-7195520927) Thanks for this, and for the world-load numbers. #94 covers the same refusal and keeps the full-texel write the typed-buffer-store path uses (a raw gapped dmask isn't a valid DXIL store mask), so we're landing that one. Closing as a duplicate.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.