Shaders: image stores of some channels, to mip 0, and to integer views #1955
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1955
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1955"
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?
@RaghavVijayanand on GitHub · 2026-11-25 01:45 UTC · original
RaghavVijayanand:shader/image-stores→main· +600 −65 · 5 files · 4 commits · openThree image-store refusals in the translator. Each is its own commit, and each builds and passes tests.
image_store_mip: a level that is a constant 0 stores to the view's own level. A non-zero or computed level is still refused, because it would need a view per level.textureStore.i32. Integer views with no atomic still get a float store; that is documented.Tests: the new
emit/image_store_tests.rs(6 tests) covers:Each program is validated with dxil.dll and run on the default hardware adapter and WARP. Each fix was broken on purpose to confirm a test fails. The test host gains
View::Uint4TextureUav(RGBA32_UINT) beside main'sUint2TextureUav. The integer-store detection also treats main's 64-bit atomics (R32G32_UINT) as proof of an integer view.This PR and #1956 (cube/MSAA) both touch
image()inemit/lower.rs, so merging both needs a small manual merge.Rebased onto current main (
940d32f). On this machine, 5 tests fail on main itself, with or without this change:descriptor::host::tests::dynamic_slots_are_held_until_released,memory::tests::lists_share_a_table_and_copies_keep_their_views, the twostride_tests::a_heap_buffer_read_*tests, andsynthetic_tests::gathers_at_a_level_match_the_hardware. Everything else passes, and clippy passes with-D warnings, with and without--all-features.An image_store whose dmask left out a channel stopped the program ("an image store of some channels"). Its data VGPRs hold the enabled channels only, in channel order (d16: two per VGPR, low half first), and the console writes the channels left out as 0 (the ISA guides' DMASK description; LLVM trims zero channels from image stores on the same grounds). The store now maps each data dword to its channel and writes 0 to the others. The host's store still writes all four channels with a 0xF mask: dxil.dll refuses a typed UAV store with a narrower mask ("store on typed uav must write to all four components of the UAV"), which was checked by emitting the dmask as the mask. Tests: emit/image_store_tests.rs hand-assembles a compute program that fills texel (1, 1) of a 2x2 texture UAV with a four-channel store, then stores to it with the dmask under test; the program is validated by dxil.dll and run on the default hardware adapter and WARP, and the whole texture is read back. They cover all fifteen dmasks on RGBA32_FLOAT, seven d16 dmasks, and RGBA32_UINT and R32_UINT views with denormal, NaN and negative-zero bit patterns (which reach the integer views unchanged through the float store on both). The host harness gains an RGBA32_UINT texture UAV, and texture readback takes each view's format. With each data dword put in the channel of its index rather than its channel's, all three tests fail.image_store_mip stopped the program ("an image store to a mip level"). Its level, the address after the coordinates, counts from the descriptor's base level, and DXIL's textureStore has no level: a UAV views a single level. Taking the host's view to be the one the title made for that base level, a store to level 0 is a store to the view, and now lowers as image_store does (the level read as a constant, either half with 16-bit addresses). Another level would need a view per level, which the title's heap does not hold; it, and a level the program computes, still stop the program, now with "an image store to a mip level other than 0 or unknown". The packed stores (image_store_pck, _mip_pck), which also stopped it under the old message, now stop it with their names. Tests: in emit/image_store_tests.rs, image_store_mip with an inline 0 level is validated by dxil.dll and run on the default hardware adapter and WARP (RGBA32_FLOAT dmasks 0xF and 0x9, R32_UINT dmask 0x1), and levels 1 and a root constant are checked to stop the program. With the check loosened to accept any constant level, the second test fails.@Marvisak on GitHub · 2026-11-25 02:19 UTC · original · edited 2026-11-25 16:03 UTC
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-shader/src/emit/lower.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (merge candidate) was for an older state ofmain.Generated by Claude Code
@StExpeditus on GitHub · 2026-11-25 09:00 UTC · original
Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at
6abd8ff.cargo test --workspace --locked --no-fail-fast-> 702 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.@sinan-cmyk on GitHub · 2026-11-25 11:05 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head
6abd8ff6ontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
6abd8ff64cto43229cd38b@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 01:45 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
@catminou4 on GitHub · 2026-11-25 03:14 UTC · original · approved these changes
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked.144 passed / 0 failed / 2 ignored. Image stores of some channels, to mip 0, and to integer views — partial-channel store lowering.
@RaghavVijayanand on GitHub · 2026-11-26 10:42 UTC · original
Rebased onto
main63bcca4. Two adjustments for whatmaingained since: the test harness's new zeroing of texture UAVs passes the texture's format tofootprint_as(which this branch made format-aware), and the handle cachesmainadded (entry block, join block) are keyed on both property dwords, as in #1953. Each commit builds. On an RTX 5060 Laptop: the image store/atomic tests pass (7), clippy is clean, and the rest ofvictory-shaderpasses except the three NVIDIA 1M-view-heap-cap tests that fail on unmodifiedmainthere too (stride_testsx2,gathers_at_a_level_match_the_hardware).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.