Skip to content

Shaders: signature rows keep the console's order and one interpolation mode - #699

Open
Praisser wants to merge 1 commit into
fxceless:mainfrom
Praisser:shader-fixes
Open

Praisser wants to merge 1 commit into
fxceless:mainfrom
Praisser:shader-fixes

Conversation

@Praisser

Copy link
Copy Markdown

Two fixes to the ISG1/OSG1/PSG1 parts that make 142 more of the title's programs pass the DXIL validator.

Measured

victory translate --validate over all 26,148 programs, on main (310c6eb) against this branch, VICTORY_HOST_MAX_WAVE=32:

validated main this branch
vertex and pixel 14,065 14,173
mesh 8,657 8,691
compute 2,722 2,722

Changes

  • Element order. signature() sorted elements by (row, column). The validator rebuilds the parts from the metadata in element order and compares the bytes, so a program that lists elements out of register order (for example TEXCOORD16 before TANGENT0 in row 10) was refused. Elements now keep their order; the only reordering left puts unplaced elements (no row) last.
  • One interpolation mode per row (container::unify_row_modes, called at the start of Shader::finish). The validator refuses a row whose elements have different modes. A row takes the mode of the elements the program reads. When none of them is read, or on an output row that has a constant member, the row is constant. A row whose read elements disagree is left alone.
  • Tests: four unit tests for the above, plus a pixel test for a 16-bit write over an f16 first half (PS_DeferredTextured_c5fd36bb). The first-half change already on main passes that test.

cargo test -p victory-shader: 219 passed, 3 ignored (RTX 3070 Laptop and WARP). Clippy is clean for the crate.

🤖 Generated with Claude Code

…n mode

Measured with `victory translate --validate` over all 26,148 programs of
the title, against 310c6eb: vertex and pixel programs validated
14,065 -> 14,173, mesh 8,657 -> 8,691, compute unchanged (2,722).

- Signature parts keep the console's element order instead of sorting
  by register and column: the validator rebuilds the parts from the
  metadata in element order and compares bytes, so a program listing
  TEXCOORD16 before TANGENT0 in one row was refused.
- Elements sharing a row get one interpolation mode (the validator
  refuses a row whose modes differ): the mode of the elements the
  program reads; constant when none is read, or on an output row with
  a constant member.
- A test for a 16-bit write over an f16 first half
  (PS_DeferredTextured_c5fd36bb), which the first-half fix on main
  already passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 25, 2026 04:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@JRamos1993

Copy link
Copy Markdown

Offline check on the retail shader pack: your +142 reproduces exactly here, with nothing lost. It also covers all 22 programs of #722.

Setup: RTX 5090, Windows 11. victory translate --validate --list over the title's full shader pack, main 310c6eb against this head merged onto it, default settings (no VICTORY_HOST_MAX_WAVE). I added a local DXIL hash on each validated line.

main this PR #722
validated 25,382 25,524 25,404
newly validated 142 (39 Vs, 69 Ps, 34 Ms) 22 (Ps)
lost 0 0
DXIL changed among programs validating on both 0 0

AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.

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