Skip to content

Shaders: interpolation modes from the console container's PSV0 - #150

Open
wildheathen wants to merge 1 commit into
fxceless:mainfrom
wildheathen:interp-from-psv0
Open

wildheathen wants to merge 1 commit into
fxceless:mainfrom
wildheathen:interp-from-psv0

Conversation

@wildheathen

Copy link
Copy Markdown

The interpolation modes of interpolated elements came from DXC's defaults by type: float linear, uint constant. But the console's compiler packs a float and a uint into one signature row and declares both constant in its PSV0. So the defaults mixed modes within one row, and dxil.dll refused the shader: "signature element … has interpolation mode that differs from another element packed into the same row". This reads the modes from the console container's PSV0, by row and column, and falls back to the defaults when there's no PSV0.

It's the interpolation part of Marvisak/VIctory#1208 by @powplusplus, kept under their authorship, with its test. The only adaptation is the geometry field this fork added to Psv. #1208's other two parts are covered here already: the PSV0 string table by #61, the ISG1/OSG1 row order by #110 / #112.

Measured

victory translate --validate --list over shaders.rpf, fork 4e17478, dxil.dll 10.0.26100:

validated "interpolation mode that differs … same row" "Program Input/Output Signature does not match"
4e17478 25,382 70 72
this PR 25,443 (+61) 3 78
#112 (or #110) 25,454 (+72) 70 0
this PR + #112 25,521 (+139) 3 0

Checks

  • cargo test -p victory-shader: 211 passed. console_psv_interpolation_modes_are_preserved_for_copacked_inputs (from #1208) fails on 4e17478 with mode 2, linear, where the console says 1, constant, and passes here.
  • cargo clippy -p victory-shader --all-targets -- -D warnings: clean. cargo xtask policy: ok. cargo fmt --check reports nothing in emit/mod.rs.
  • Offline only: no title run. Windows, RTX 5080. No game data or shader names included.

The modes of interpolated elements came from DXC's defaults by type
(float: linear, uint: constant), but the console's compiler may pack a
float and a uint element into one signature row, declaring both constant
in its PSV0. Mixed modes in one row are rejected by the validator
("interpolation mode that differs from another element packed into the
same row"). The modes are now read from the console container's PSV0,
keyed by row and column, falling back to the defaults without one.

Ported from Marvisak/VIctory#1208 (its interpolation-mode part and its
test), adapted to this fork's Psv (`geometry`).
@Parakeet-Wheat

Copy link
Copy Markdown

Reproduced the table on a second machine, and checked how this combines with #110 / #112 / #124 when merging.

Offline translation and validation only; no shader contents or extracted data included. AI-assisted (Claude Code); run on my machine.

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