Shaders: lower v_mul_hi_u32_u24 and v_mul_hi_i32_i24 (port of VIctory#156) #56
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/uiliannn--VItoriaBr!56
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@lcg007xd-c on GitHub · 2026-11-25 20:57 UTC · original
lcg007xd-c:port/mul-hi-24→main· +61 −0 · 1 files · 2 commits · openWhat
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
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.