Shaders: image atomics on a handle of their own element type #1755
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1756"
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 paulomatias97-create on 2026-11-24T22:00:28Z.
Image atomics run on a handle annotated with the wrong elements. The handle cache is keyed by the first word of the resource properties only, so an image atomic after the image's size query reuses that query's handle,
RWTexture2D<4xF32>. Separately, 64-bit atomics asked for U32 elements; DXC annotates a texture of 64-bit integers as U64.umax,cmpswapwithglc,swapof the returned value) that checks the module's 64-bit atomic features.Verified
dxc -dumpbinon the test's module: before, the atomics use aRWTexture2D<4xF32>handle; after,RWTexture2D<U64>. Both versions passdxv(DXC built from source), so the validator does not catch this.cargo test -p victory-shader: 119 passed.cargo clippy -p victory-shader --all-targets --all-features --target x86_64-pc-windows-msvc -- -D warningsis clean.Not verified
🤖 Generated with Claude Code
https://claude.ai/code/session_01CL4QZxTrzfn3nkthzLyAtV
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T22:18:48Z.
Review: APPROVED
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
70564ae), cargo test -p victory-shader --locked → 119 passed, 0 failed. Hardware/valu/waterfall execution tests are #[cfg(all(test, windows))] and run only on Windows.Image atomics on a handle of their own element type: image_atomic_64_cs builds the program and a_64_bit_image_atomic_is_a_64_bit_atomic checks the 64-bit atomic lowering. +23 macOS tests vs previous main baseline (new main added tests).
Imported from Marvisak/VIctory. Originally posted by 0xKaji on 2026-11-24T22:14:16Z.
Verified
ab3c38don Linux + Wine11.22+vkd3d-proton 3.2.0(GE-Proton11-14) + NVIDIA RTX 3060 8 GB (Ampere, driver620.73.04), cross-built withcargo xwin(x86_64-pc-windows-msvc,VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains).Tests
cargo test -p victory-shader --offline: 119 passed, 0 failed, 1 ignored.emit::tests::a_64_bit_image_atomic_is_a_64_bit_atomic --test-threads=1): 1 passed, 0 failed (0.00s).Live title A/B on
70564ae(diagbuild,VICTORY_D3D12_DRED=1)70564ae(baseline): crashed at+4 s(before frame 16) witherr:vulkan:vkCreateComputePipelines Exception 0xc0000005 in Unix call.70564ae+ PR #1756 (ab3c38d): 0vkCreateComputePipelinesexceptions; boots cleanly through menus into Stage (e) world rendering (frame=1024presented withdraws=5117 drawn=5117 dispatches=1116 dispatched=1116, reachingframe=1127at+55 sbefore hitting the 8 GB VRAM ceiling onvkAllocateMemory), 0 GPUXids.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T03:40:35Z.
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
Imported from Marvisak/VIctory. Originally posted by axknxla on 2026-11-25T16:42:20Z.
What
Thanks for the original fix. I prepared a local port of paulomatias97-create’s 32-bit cache-key commit onto upstream
67e8ae14. That base has block-local, entry-block, and control-flow join caches. The port includes both resource-property words in each key so a size query and an image atomic on the same descriptor get correctly typed handles.The synthetic tests adapt acleofe’s size-query/atomic fixture from #1036 and cover all three cache paths. The diff is below if it helps with rebasing #1756.
Tested
x86_64-pc-windows-gnullvmtest binary under GE-Proton 11-14. Reverting each cache-key change individually made its matching synthetic test fail.67e8ae14, passesgit diff --check, andcargo xtask policypassed. Verification covers synthetic compiler output. GPU execution and the separate 64-bit commit remain untested here.Codex assisted with the port, synthetic tests, and verification.
Source and synthetic test diff against
67e8ae14View 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.