fix(shader): calculateLOD array coords, split wave64 masks, one interpolation mode per row #222
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/trustno1-coder--VIctory-NVIDIA!222
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-222"
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?
@mutlusinan on GitHub · 2026-11-27 19:53 UTC · original
mutlusinan:fix/shader-lod-lanes-interp→main· +143 −2 · 3 files · 3 commits · openProblem
Three translation fixes for programs this tree refuses or lowers wrongly:
calculateLODon an array. The host'scalculateLODstill takes three coordinates; a 2-D array's slice was passed as the third. It is not a coordinate, so the wrong level was read.SV_IsFrontFaceelements must stay constant; otherwise a used element's mode was not carried to unread siblings in its row.Fix
calculateLOD: the slice coordinate is left undefined (2-D array: third; 1-D array: second and third), per DXIL.structure.rs: a scalar pair whose two words still come from the same known mask, in order, is recognised as that mask again (move_sourcewalks thes_mov_b32chain).emit/shader.rs:reconcile_row_interpforces a row toconstantwhen any element is integer orSV_IsFrontFace, and otherwise copies a used element's mode to unread siblings in the same row.Verification
cargo check --workspace --target x86_64-pc-windows-msvc --locked— clean.cargo test -p victory-shader— 209 passed, 0 failed, including the newsplit_scalar_copies_across_a_branch_preserve_both_words_of_a_wave64_maskandreconcile_row_interp_matches_constant_and_used_siblings.calculateLODchange has no test that does not need a device.Ported from uiliannn/VItoriaBr
18df163,a51c1eaand5943771(GPL-3.0, GPL-compatible).@mutlusinan on GitHub · 2026-11-27 20:21 UTC · original
Risk assessment (porting review)
calculateLOD: the kind mapping was checked in this tree (crates/victory-shader/src/emit/lower.rs:11259):dim 4 → kind 6(1-D array, one coordinate) anddim 5 → kind 7(2-D array, two), so the new branches match the coordinate counts the surrounding code already uses (coords - usize::from(kind == 6 || kind == 7)).SV_IsFrontFaceelement forces the row toconstant; otherwise a used element's mode wins. It relies onSigElement.rowbeing the DXIL row, which is what the emitter builds. Coverage is synthetic, not real title signatures.victory-shader, including the two added here. Not exercised against real title shaders in this environment.mainate69e39c.@1tsethan on GitHub · 2026-11-27 23:00 UTC · original
Independent Windows validation of PR #222.
Tested commit:
70850847cf90286da86be0deaa102b6079054dda.cargo test --locked -p victory-shader reconcile_row_interp -- --nocapture --test-threads=1Exit: 0.
Coverage here is the interpolation-row regression only; calculateLOD array behavior and other changes still need dedicated device/output validation.
Independent verification with OpenAI Codex assistance. Windows 11 Pro build 26200; Rust 1.98.1 MSVC; Windows SDK libraries from Microsoft.Windows.SDK.CPP.x64 10.0.28000.2957. Test harness used an RTX 3070 Ti / AMD integrated-GPU host; adapter identity was not captured for every test. These are focused checks on the stated PR commit, not gameplay, FPS, or a merged-main integration result.
View 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.