Shaders: lower v_div_fixup_f16 (port of upstream VIctory #379) #1040
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/fxceless--victory-fork!1040
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1040"
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?
@Moon0755 on GitHub · 2026-11-25 17:04 UTC · original
Moon0755:fix/v-div-fixup-f16→main· +116 −0 · 2 files · 1 commits · openPort of upstream
Marvisak/VIctory#379(originally authored by@LouisRiverstone).Summary
Adds DXIL lowering for the RDNA2 16-bit division fixup instruction
v_div_fixup_f16.Previously,
Lower::valu16did not handlev_div_fixup_f16, rejecting shaders that use half-precision division fixup sequences.Changes
crates/victory-shader/src/emit/lower.rs:"v_div_fixup_f16"toFLOAT3inLower::valu16and dispatched it toLower::div_fixup(a, b, acc)inLower::valu16_op(sohalf_fsrc/float_resultapply source/destinationop_sel,abs/neg,omod,clamp, and half preservation automatically).Lower::div_fixupfollowing the RDNA2 (gfx1036) ISA special-case precedence order on exact f32 representations: numerator NaN, denominator NaN,0/0orinf/inf-> qNaN,x/0orinf/x-> signed infinity,0/xorx/inf-> signed zero, quotient overflow / NaN -> signed infinity, otherwisecopysign(|q|, num ^ den).crates/victory-shader/src/emit/valu_tests.rs: addeddiv_fixup_f16_referenceand D3D12 WARP regression testv_div_fixup_f16_follows_the_isa_special_casesexercising 400 combinations of quotients, denominators, and numerators (including±0, subnormals,±inf, qNaN, sNaN, and verifying the upper 16 bits of the destination VGPR remain unchanged).Verification
Verified on
windows-latestvia GitHub Actions (run 45660058837):cargo clippy -p victory-shader -p xtask --all-targets --locked -- -D warnings— passedcargo clippy -p victory-shader -p xtask --all-targets --all-features --locked -- -D warnings— passedcargo test -p victory-shader -p xtask --locked -- --nocapture—216 passed; 0 failed; 3 ignored(includingv_div_fixup_f16_follows_the_isa_special_casesexecuted on D3D12 WARP, plusxtask4 passed,repository_passes_policypassed)— Neon
@HAL9000RELOADED on GitHub · 2026-11-25 18:01 UTC · original
A hardware run of this PR's new test:
v_div_fixup_f16_follows_the_isa_special_casespasses on a Radeon RX 7900 XTX (RDNA3), Windows 10 22H2, with #402's Agility SDK runtime. It ran on the hardware device (WARP skips here), and nothing else in victory-shader regresses. The setup, and the same run for eight related ports, are in one table on #1030: #1030View 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.