Repository navigation
Shaders: lower image_store with any non-zero channel mask (including sparse) - #146
Open
davi713albano-coder wants to merge 1 commit into
Open
davi713albano-coder wants to merge 1 commit into
davi713albano-coder wants to merge 1 commit into
Conversation
JustDownTV
pushed a commit
to JustDownTV/victory-gta6
that referenced
this pull request
Nov 24, 2026
davi713albano-coder
force-pushed
the
shader/image-store-partial-dmask
branch
from
November 25, 2026 03:42
e232f2a to
67f7ff0
Compare
|
RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lowers
image_storefor all non-zero channel masks (0x1..=0xF, including sparse masks such as0x5,0x9,0xD, both 32-bit float andd16packed f16) and treatsdmask == 0as a no-op (without normalizing it to0x1as loads/samples do).In RDNA2,
image_storepacks only the channels enabled bydmaskinto consecutive VGPRs (or 16-bit halves whend16is set) and writes0.0to disabled channels. DXIL typed UAVdx.op.textureStore.f32requires a full0xFwrite mask on 4-component declarations (the host format drops channels past its width), so disabled channels are zero-padded with0.0f32.Changes
crates/victory-shader/src/emit/lower.rs:dmask == 0intact forimage_store(returningOk(())as a no-op instead of normalizing to&1).d16halves for each enabled bit indmask(0x1..=0xF), zero-padding unselected channels with0.0f32, and emitdx.op.textureStore.f32(..., 0xF).crates/victory-shader/src/emit/valu_tests.rs:image_store_partial_dmask_writes_expected_channelstesting 10 cases (0x0,0x1,0x3,0x7, sparse0x5,0x9, andd160x1,0x3,0x7,0xD) againstdxil.dllvalidation and live D3D12 WARP 4-channel RGBA readback.Verification
windows-latest): https://github.com/davi713albano-coder/victory-fork/actions/runs/45494029704cargo clippy --workspace --all-targets --locked -- -D warnings: passedcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passedcargo test --workspace --locked(includingxtaskasset-policy check,dxil.dllvalidation, and D3D12 WARP readback): 497 passed, 0 failed (emit::valu_tests::image_store_partial_dmask_writes_expected_channels ... ok)(No title data used. AI-assisted.)