Skip to content

R-7: take signature interpolation modes from the console PSV0 - #66

Merged
ShinniUwU merged 1 commit into
ProjectLeonidaL:mainfrom
sanchaton:fix/r7-validator-2
Nov 27, 2026
Merged

ShinniUwU merged 1 commit into
ProjectLeonidaL:mainfrom
sanchaton:fix/r7-validator-2

Conversation

@sanchaton

Copy link
Copy Markdown
Contributor

What changed

R-7 (partial): signature elements took their interpolation mode from a table keyed by type, so every float element came out linear. The console's own containers declare some of them constant (for example TEXCOORD9 next to SV_IsFrontFace), and the DXIL validator refused 70 programs that then packed two modes into one register. The mode of each element is now read from the console container's PSV0 part (container::psv_modes, take_modes) and applied by register and column to vertex and mesh outputs and pixel inputs; rect.rs keeps a mode already set instead of rewriting it. No register or mask changes, so both sides of a stage link keep the modes the console linked them with.

Independent of #64. The two branches only meet where both append a unit test at the end of container.rs's test module and a note at the top of docs/fork-notes.md; whichever merges second needs a trivial rebase.

How it was tested

  • Not run in game: tests and a shader census only. The draws these pipelines bring back have not been checked in game yet; no frame-rate change is claimed.

Checks run on this branch:

  • cargo test --workspace --locked: no failure (leonida-shader 218 passed, 3 ignored; run with -j 2)
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo xtask policy

leonida translate --list --validate --jobs 2 with release builds of f3c94ca and this branch, compared program by program over every program:

main This branch
Vertex and pixel validated 14 099 14 143
Mesh validated 8 657 8 674
Refused for an interpolation mode that differs 70 3

61 more programs validate and none that validated before is refused now. Of the 67 fixed for interpolation, 6 are then refused for signature row order, which #64 fixes; with both, 67 should validate (not measured together). Still refused for interpolation: PS_RasterizeWaterVolumeExposedSurface and two PS_RasterizeVehicle*InterfaceDepth.

AI

  • AI-assisted: investigation of the console PSV0 layout, fix, unit test, census and review.

@ShinniUwU

Copy link
Copy Markdown
Contributor

Please rebase on main (conflict in docs/fork-notes.md). One more thing: #64 also adds a test helper named element at the end of container.rs's test module, with different arguments (name, kind, interp, row, col, cols there, interp, comp, row, col, cols here). #64 is planned to merge first, so please rename this one (for example psv_element) so both compile together.

@sanchaton

Copy link
Copy Markdown
Contributor Author

Rebased on main (now 09680ae on top of 8fbb66b), and the test helper is renamed psv_element so it no longer collides with #64's element. The only rebase conflict was the top of "Newest" in docs/fork-notes.md: this note is first and every note from main is kept, no line removed. On the rebased branch: cargo clippy (with and without --all-features) is clean, cargo test --workspace --locked has no failure (leonida-shader 222 passed, 3 ignored), and cargo xtask policy passes.

Once #64 merges, this branch will still meet it at the end of container.rs's test module (both append a helper and a test there) and at the top of docs/fork-notes.md; I will rebase again then, keeping both helpers and both tests.

@sanchaton

Copy link
Copy Markdown
Contributor Author

Correction to my comment above: you had already rebased this branch on main and renamed the helper (b9fe3ce on top of f259ee5) before my push, so my push was refused and the branch is yours as it stands. I compared it with my own rebase: the code under crates/ is identical, and docs/fork-notes.md keeps every note from main. The clippy, test and policy results I quoted were on my rebase of the same code on 8fbb66b. Thanks for the rename.

…PSV0

The type table made every float linear, splitting registers the console packed with one constant mode, which the DXIL validator refuses. The console PSV0 lists each element mode; it is applied by register and column to vertex or mesh outputs and pixel inputs, and kept by the rectangle-list stage. No register or mask changes. 61 more programs validate, none regress.
@ShinniUwU

Copy link
Copy Markdown
Contributor

Rebased on main after #64 merged (now 2ce115a). In container.rs's test module both helpers and both tests are kept (element from #64, psv_element here); the rename commit folded into the main commit. cargo test -p leonida-shader --lib container:: passes 3 of 3. No need to rebase this one again.

@ShinniUwU
ShinniUwU merged commit 7236347 into ProjectLeonidaL:main Nov 27, 2026
1 of 2 checks passed
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.

2 participants