Repository navigation
Shaders: lower RDNA2 lighting multiply in DXIL - #2938
andrewpozdnakov7-jpg wants to merge 1 commit into
Conversation
|
Code review and RTX 5090 + WARP + DXIL verification at head
Clean submodule split and thorough special-value handling; LGTM. |
Dukestar69
left a comment
There was a problem hiding this comment.
Tested merged onto origin/main (63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP, dxil.dll validator active):
cargo test -p victory-shader --lib emit::valu_tests::v_mullit: 1 passed, 0 failed (v_mullit_f32_applies_lighting_rulespasses on both RTX 5090 hardware and WARP).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 192 files ok.
The lowering in emit/lower/lighting_mul.rs cleanly handles abs/neg bit-level source modifiers, RDNA2 lighting sentinel/limit checks, post-rounding tininess near 2^-126 via 2^64 scaling, omod, and clamp.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
…t, sat mul24 - Marvisak#2953: v_div_fixup_f64 in 32-bit ops (quotient classification, overflow and underflow handling, DX10 clamp) - Marvisak#2799: v_rcp_f64 (96/48-bit divisor refinement to 2^-53) - Marvisak#2811: v_rsq_f64 (denormal normalization, guarded reciprocal) - Marvisak#2791: v_sqrt_f64 (non-restoring refinement with sticky bits) - Marvisak#2743: v_ldexp_f64 (52-bit significand scaling, subnormal rounds) - Marvisak#2938: v_mullit_f32 lighting multiply (NaN/zero/limit handling) - Marvisak#2926: v_mul_*_u24/v_mad_*_u24 via valu_mul24; the clamped form now saturates against the full 48-bit product instead of failing emit Rounding-mode reads assume the console's initial 16/64-bit mode (nearest even, denormals preserved): the MODE register is not modelled, so shaders changing it already fail emit. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Automated triage for the maintainers. Merge candidate. Adds a DXIL lowering for CI: passing. Generated by Claude Code |
What changed
The DXIL lowerer now handles VOP3 opcode 0x150 in the default f32 mode used by VIctory. A positive, ordered third operand enables the multiplication. The right operand's negative maximum-finite, negative infinity or NaN encoding returns negative maximum-finite. The result then follows the measured priority of the legacy zero and left NaN rules.
The product's underflow check uses a scaled multiply so the decision at the smallest normal can be made after rounding to 24 significant bits. The lowering applies source abs/neg and output scale/clamp while preserving the relevant NaN payload and zero bits. The behavior comes from public physical RDNA2 reports. Operand rules and source modifiers, flushed inputs, product rounding, output modifiers.
Validation
AI-assisted.