Shaders: lower partial-channel typed buffer stores #342
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/342"
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?
Imported from Marvisak/VIctory. Originally posted by tarcisioads on 2026-11-24T02:24:45Z.
Support partial-channel typed
buffer_store_format_*(count < 4) incrates/victory-shader/src/emit/lower.rs:count1..=4 in typedbufferStore.f32(still rejecting*offen || *offset != 0), padding unused channels up to 4 withundef(f32) and passing(1u8 << count) - 1as thewriteMask.partial_channel_typed_buffer_store_lowerscoveringbuffer_store_format_x,buffer_store_format_xy,buffer_store_format_xyz, andbuffer_store_format_d16_xyz.Verification
cargo test -p victory-shader(57/57 passed on macOS; Windowsdxil.dllvalidation not run)rustfmt --edition 2024 --check crates/victory-shader/src/emit/lower.rs(ok)cargo xtask policy(ok)Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-24T03:14:33Z.
Review note: typed stores now pass a partial mask (
i8((1u8 << count) - 1)), and the DXIL validator rejects that for a typed UAV. Adding validation to this PR's own fixture (dxil.dll from the Windows SDK) fails withDXIL's
bufferStoreon a typed buffer has to write all four components (mask0xF); the components the instruction does not supply need explicit values. D3D12 only checks the container hash, so a driver may still accept the module, which is why the test passes without the validator. What the hardware writes to the components a typed buffer store leaves out I could not find stated for MTBUF; for image stores the RDNA 2 ISA says the missing components get 0.From the documents and synthetic tests only; I have no copy of the title and have not run this on console hardware.
Imported from Marvisak/VIctory. Originally posted by tarcisioads on 2026-11-24T11:18:55Z.
Rebased onto
main(ffe310e) and addressed @r4tedx's DXIL validator feedback in4950d61:bufferStore.f32with0.0f(self.s.m.f32(0)) and pass0xFas thewriteMask.cargo test -p victory-shader(97 passed, 0 failed on macOS;dxil.dllvalidation still needs Windows).Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:28:44Z.
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main(conflict incrates/victory-shader/src/emit/lower.rs). It will be reviewed again once it is rebased.From the earlier needs-work note, still open: evidence for zero-filling the channels a partial typed buffer store does not supply (or refuse those cases), and
dxil.dllvalidation inpartial_channel_typed_buffer_store_lowers.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.