Repository navigation
Conversation
|
Ran on RDNA2 hardware through vkd3d-proton on a Steam Deck (not native Windows): AMD Van Gogh, RADV 26.1.99, SteamOS 3.8.28, Proton 11.0-3 (wine-11.0) with its vkd3d-proton 212991fc. Windows MSVC test binary (rustc 1.100.0) built from head
Not tested: native Windows AMD drivers; WARP (this setup has none, so the WARP leg ran on RADV too); whether the new test fails without the fix on this host. AI-assisted (Claude Code, Claude Opus 5.5); no game data. |
|
Automated triage for the maintainers. Closing because another open pull request covers the same change. See #162. Lowers v_sad_u8, v_msad_u8, v_sad_u16 and v_sad_u32, which the title does not use. The clean #162 covers the same instructions plus v_sad_hi_u8. 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
Lowers RDNA2's unsigned sum-of-absolute-differences (SAD) instruction family in
crates/victory-shader/src/emit/lower.rs:v_sad_u8(VOP30x15A): sum of 4 unsigned byte absolute differences +src2accumulator.v_msad_u8(VOP30x171): masked 4-byte SAD — lanes wheresrc0's byte is0contribute0regardless ofsrc1(whilesrc1 == 0is not skipped).v_sad_u16(VOP30x15C): sum of 2 unsigned 16-bit absolute differences +src2accumulator.v_sad_u32(VOP30x15D):|src0 - src1|+src2accumulator.clamp(unsigned saturation tou32::MAXon accumulator overflow) across all four instructions, while rejecting invalidomod/abs/negmodifiers.Tests
Added end-to-end synthetic GFX10 compute shader test
v_sad_family_matches_rdna2incrates/victory-shader/src/emit/valu_tests.rs(validated viadxil.dlland executed on both host GPU and WARP), covering:v_sad_u8(normal accumulation,u32wraparound, andclampsaturation tou32::MAX)v_msad_u8(zero-masking onsrc0bytes vs. non-masking onsrc1 == 0)v_sad_u16(normal accumulation andclampsaturation)v_sad_u32(normal accumulation,u32wraparound, andclampsaturation)Verification
cargo test -p victory-shader v_sad_family: passed on Windows 11 x64 / NVIDIA GeForce RTX 5090 (Blackwell) + WARPcargo clippy -p victory-shader --all-targets: 0 warningscargo xtask policy:asset policy: 155 files okAI-assisted (Gemini 4 Neon).