Shaders: emit the valid DXIL intrinsic for f64 FMA #202
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!202
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-202"
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?
@loyodea on GitHub · 2026-11-25 21:33 UTC · original
loyodea:shader-f64-fma-dxil→main· +30 −1 · 2 files · 1 commits · openDouble-precision fused multiply-add emitted a declaration that DXIL validation rejects. Use the canonical
dx.op.tertiary.f64entry point for opcode 47 and retain the existing double-precision flags. The regression puts all operands and the destination in disjoint registers and includes cancellation that distinguishes one rounding from separate multiply and add operations.Tested
cargo test --locked --jobs 4 -p victory-shader --lib v_fma_f64_rounds_once -- --test-threads=1 --show-outputreproduced the validator error before the fix. With the fix all 12 result-word checks passed, six on hardware and six on WARP.victory-shaderpackage run reported 281 passed, 0 failed, and 7 ignored. Four compiler-dependent checks returned early because the optional compilers were unavailable.git diff --checkpassed. The asset-policy check still flagslower.rsfor exceeding the 512 KiB file limit, which it already exceeded at upstream base4f62c2a.Retail titles, frame rate, the pinned MSVC toolchain, and other GPU drivers remain unverified. The tests use original synthetic shaders.
AI use
OpenAI Codex with GPT-6.2 Sol (extra-high reasoning for the implementation and final checks) wrote the fix, verified the regression, and ran the tests.
@MamaLeVrai on GitHub · 2026-11-26 05:00 UTC · original
RDNA2 data point. This PR (
3b26bce) merged onmain4f62c2a,cargo test --release -p victory-shader --libon an RX 6950 XT (Windows 11 build 26300, Rust 1.98.1):main: 275 passed, 2 failed.The 2 failures are the same as on
main: the RDNA2 wave-size testsscalar_counted_in_a_divergent_loop_read_after_itandscalar_counted_in_nested_divergent_loops, fixed by #110 and #204. No regression here. Not run in the game.harness machine: rx6950xt-w11 | AMD Radeon RX 6950 XT (RDNA2), driver 32.0.21045.29003 | 32 GB RAM | Windows 11 build 26300
AI-assisted (Claude Code); no game data.
@loyodea on GitHub · 2026-11-26 18:53 UTC · original
Thanks for running this twice on the RX 6950 XT. Both runs passed the new fused-rounding regression and reproduced the same two baseline wave-size failures tracked in #110 and #204.
@adrianmjim on GitHub · 2026-11-26 19:48 UTC · original
Tested on a different GPU, plus a full-title shader run.
Setup: Windows 11 26300, RX 7900 XT (RDNA3), driver 32.0.32029.2010, Rust 1.98.1. Head
3b26bceon base4f62c2a.v_fma_f64_rounds_oncewith the fix: all 12 checks pass, 6 on the RX 7900 XT and 6 on WARP. Without the fix on4f62c2ait fails DXIL validation with the same'dx.op.fma.f64' is not a DXILOpFuncition for DXILOpcode 'Fma'error.cargo test -p victory-shader --lib -- --test-threads=1: 278 passed, 0 failed, 6 ignored.4f62c2agives 277/0/6, so the only difference is the new test.translate --validate --host-lanes 32-64over the full GTA VIshaders.rpf(26084 programs): the output is identical to4f62c2a. All 25623 per-program DXIL hashes match, and so do the validation counts, the refusals and the IR instruction total.v_fma_f64.shader-info --disasmfinds only two f64 VALU instructions:v_add_f64(5 programs) andv_cvt_f32_f64(5 programs).So on RDNA3 the new declaration passes validation and gives single-rounding results, but it has no effect on this game's shaders. Not tested: other titles, in-game rendering, and the tests outside
--lib.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.