fix(shader): calculateLOD array coords, split wave64 masks, one interpolation mode per row #222
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mutlusinan on 2026-11-27T19:53:41Z.
Problem
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).Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mutlusinan on 2026-11-27T20:21:18Z.
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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by 1tsethan on 2026-11-27T23:00:42Z.
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.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mutlusinan on 2026-11-28T12:01:30Z.
Rebased onto current
mainRebased onto
63b902f(force-with-lease); no conflicts — the three commits still apply to the currentlower.rs/structure.rs/shader.rs.Re-verified after the rebase:
cargo check --workspace --target x86_64-pc-windows-msvc --locked— clean.cargo test -p victory-shader -p victory-core -p victory-formats— 209 / 16 / 46 passed, 0 failed, including the two tests these commits add.No equivalent of any of the three fixes is on
main(checked:reconcile_row_interp,move_source, and the array-coordinate branch ofcalculateLODare absent), so the risk note above stands unchanged. CI showsaction_required(maintainer approval to run a fork's workflow).