Shaders: lower v_mul_hi_u32_u24 and v_mul_hi_i32_i24 (port of VIctory#156) #56
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/56"
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 uiliannn/VItoriaBr. Originally posted by lcg007xd-c on 2026-11-25T20:57:26Z.
What
v_mul_hi_u32_u24andv_mul_hi_i32_i24(VOP2 0x0C / 0x0A) had no lowering, so any shader that used them failed to translate. Their low-dword partnersv_mul_u32_u24/v_mul_i32_i24were already lowered.They now give the high dword of the same 48-bit product. Each operand's low 24 bits are zero- or sign-extended, then go through the existing
mul_hi.Port
Cherry-pick (
-x) ofgithub.com/Marvisak/VIctory@344704efrom upstream. Rareuncommon is still the commit author. It applied cleanly. It also adds a smalllowers_valutest helper: a one-thread compute program that storesv0, so a VALU instruction can be checked for lowering without a GPU.Test
the_24_bit_multiplies_lower_both_halveslowers all four 24-bit multiplies. With the new match arm reverted it fails (v_mul_hi_*is unsupported). With it, it passes.How this was checked (Linux, no Windows PC or game files)
cargo clippy -p victory-core -p victory-pe -p victory-pipeline -p victory-shader -p victory-formats -p victory-game -p xtask --all-targets --locked -- -D warnings, thencargo teston the same crates (rebased on currentmain).cargo clippywith the same crates and--target x86_64-pc-windows-msvc(check only, no link) is clean.lower.rshas the same number ofrustfmtdifferences before and after this change, so the added code is rustfmt-clean.Not tested: Windows runtime, GPU, and the game itself. In particular, the numeric results were not run on a GPU here. The new test only proves the instructions now lower, and Windows CI validates the module where
dxil.dllis available.🤖 Generated with Claude Code
Pull request closed