Skip to content

Preserve mesh output interpolation from native PSV0 - #858

Closed
Kamiloj9 wants to merge 1 commit into
fxceless:mainfrom
Kamiloj9:codex/preserve-native-mesh-interpolation
Closed

Kamiloj9 wants to merge 1 commit into
fxceless:mainfrom
Kamiloj9:codex/preserve-native-mesh-interpolation

Conversation

@Kamiloj9

Copy link
Copy Markdown

Change

Read mesh vertex-output interpolation modes from the original shader's PSV0. Match its records to the OSG1 entries by semantic name and index, row, column, width, and original component type. Apply the result only when the allocated generic float entries match unambiguously and the resulting modes agree within each affected packed row.

The previous type-based default declared a flat float beside a flat integer as linear. For two captured mesh programs, the original metadata and the linked pixel shader agree on the flat mode.

Verification

  • Synthetic test covers semantic matching across different record orders, truncated metadata, an unmatched semantic index, and a conflict in the resulting row.
  • Both affected mesh modules and their paired pixel module pass the CPU DXIL validator on this PR branch.
  • In the integration checkout, 615 of 617 captured mesh modules validate, up from 613. Every previously valid module still passes. The two remaining failures exceed the 32 KiB mesh output limit.
  • The disassembled instruction bodies of the two affected modules are identical before and after the change. The matched pixel DXIL is byte-for-byte identical.
  • Independent review and the asset policy passed. Verification was offline. Game captures and generated shader artifacts remain local.

(cherry picked from commit 5c0073ce5ffc8d753d69390b9aa425a8941dbfd5)
@avt0m4t48

Copy link
Copy Markdown

I independently checked the exact base f85101b and head 9b57cb8 with 11 original synthetic mesh metadata cases. In two different PSV0 record orders, the emitted float beside a flat integer changed from mode 2 to mode 1, and a separate float declared as sample interpolation changed from mode 2 to mode 7. The integer and linear float controls kept their modes.

Eight fallback cases emitted byte-identical DXIL containers to base, including duplicate matches, a wrong semantic name or index, a packed-row conflict, and a truncated signature record. Truncation confined to the trailing input/output dependency masks preserved the recovered modes, since those masks are outside the signature tables used here.

The untouched Linux shader suites passed with 171 tests at base and 172 at head, with two ignored each. Windows MSVC cross-target cargo check --tests passed at head. This cycle checked emitted metadata and compilation. It used no game files and did not run Microsoft DXIL validation, Windows execution, or GPU readback.

AI-assisted using Codex.

@MamaLeVrai

Copy link
Copy Markdown

Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head 9b57cb8 into main f85101b in a throwaway tree (no conflict). cargo clippy --workspace --all-targets --locked -- -D warnings fails with exactly the errors main itself has on this machine (placed_filler_twins, depth_written, a sort; PR #841 fixes them), also with --all-features; this PR adds none. cargo test --workspace --locked: run 1: stopped at indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields (the one that fails on main itself most runs here (PR #849 and #847 fix its assertion)); run 2: stopped at indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields (the one that fails on main itself most runs here (PR #849 and #847 fix its assertion)) (main alone: 555 passed, 0 failed, 11 ignored). The title was not run, so this says nothing about in-game effect. No game data.

AI-assisted (Claude Code); no game data.

@Kamiloj9 Kamiloj9 closed this Nov 26, 2026
@Kamiloj9
Kamiloj9 deleted the codex/preserve-native-mesh-interpolation branch November 26, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants