Repository navigation
Shaders: 64-bit image atomics lowering to dx.op.atomicBinOp.i64 and a… - #1127
ashrafsdrop wants to merge 3 commits into
Conversation
…tomicCompareExchange.i64
|
This PR has no CI run yet, so I ran the CI's checks at head But the DXIL validator rejects the program from Declared This is also the fourth open PR for 64-bit image atomics, after #305, #539 and #705. On #305, h0useadv measured that those three give the same +520 validated programs ( |
|
This is the second open PR for 64-bit image atomics (the other is #539), so I reviewed it against that one directly. Windows 11 / Rust 1.98.1, 1. The handle cache collides between the two widths — this is the one real defect. 2. The SFI0 feature declaration is thinner than #539's, and that is the difference most likely to show up as a validator rejection. This PR sets only 3. What checked out line by line against the 32-bit path and against #539. The 4. Shared gap with #539: no GPU fixture — the Recommendation: these two should be reconciled into one, not merged separately — they touch the same |
|
Thanks for the sharp reviews @shortselow-byte and @adamdotpy. Addressed both points in
All 122 tests in |
|
Verified 1. The cache collision — fixed at the right place, and better than my suggestion. Adding 2. The SFI0 flags — now asserted and validated, not just asserted. What is still open on both this and #539 is the same and is now cheap to close with the template from #1065: a GPU fixture (waterfall_tests style) that runs a 64-bit atomic, plus the live-title refusal count, which only #539 has so far. With the collision and the flags settled, the remaining difference between the two PRs is shape (your uniform |
|
Appreciate the verification and comparison against #539 @adamdotpy! Glad the uniform handle key and SFI0 flag mappings checked out on the live validator. |
|
Reviewed Found three issues that prevent
Verification (
|
… atomics Declare ATOMIC_INT64_TYPED (SFI0 0x40_0000) and ATOMIC_INT64_HEAP (SFI0 0x1000_0000) alongside INT64 so dxil.dll accepts 64-bit typed UAV atomics. Tag 64-bit integer texture UAV handles as U32 (0x105) matching DXC over R32G32 views and key the per-block handle cache on the full (kind, tag) pair so preceding float4 queries (e.g. image_get_resinfo) do not collide. Materialize atomic operands and handles before begin_guarded to preserve SSA dominance across divergent lane masks, and omit dead join phis when glc is unset. Add dxil.dll validation and multi-adapter D3D12 readback tests.
|
Thanks @fuzeofficlal for the thorough hardware testing across RTX 5090, AMD iGPU, and WARP, and for catching the SSA ordering and element tag details! Integrated in commit a0b441d:
|
|
Verified the new head |
Offline measurement on a retail dump, and the shader tests on AdaResult: +520 programs over Offline. I merged head a0b441d onto
All 520 are the same programs that #1467 gains, and the same ones that #1402 gains through #305 (64-bit image atomics). So #305, #539, #1127 and #1467 cover one set. On this data, review can pick between them on correctness and coverage alone. Tests: with the same merge, No shader names or data are included, per the asset policy. AI-assisted (Claude Code). |
|
Automated triage for the maintainers. Closing because this change is already in 64-bit image atomics. In main since today (lower.rs:7404-7510, test image_atomics_of_64_bits). Same as #539; also edits README. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
Summary
Implements 64-bit image atomic operations in
victory-shader::emit::lower.dmask(dmask == 3for standard atomics,dmask == 0xFforcmpswap).i64integers.atomicBinOp.i64(opcode 78) andatomicCompareExchange.i64(opcode 79).props1 = 0x107, 1 component of U64).glcis active.INT64shader model feature flag in DXIL SFI0 metadata.image_atomic_64_bit_lowers_with_int64_featureto verify lowering and SFI0 metadata.Verification
cargo test -p victory-shader: 121 tests passed, 0 failed.cargo test --workspace: all workspace crates passing cleanly.cargo run -p xtask -- policy: asset policy passes (154 files ok).