Repository navigation
Conversation
DXIL gives every element packed into a signature row one interpolation
mode; the validator refuses a pixel program whose row mixes two
("signature element ... has interpolation mode that differs from another
element packed into the same row"). The console's compiler packs pixel
inputs by register alone, since its shader code does the interpolation,
so a row can hold a flat element beside an interpolated one, or an
element no code reads, left at its default mode, beside one that is
read another way.
- shader::harmonize_input_rows: an element nothing reads takes the mode
of the row's read elements (an integer element only ever constant); in
a row nothing reads, a row holding an integer is made constant.
- Lower::mixed_row: a row read in two modes, or interpolated beside a
flat read or an integer element, is declared constant, and its
interpolations weigh the vertices with SV_Barycentrics, as rows read
per vertex already are (Lower::per_vertex).
On the retail shader pack with VICTORY_HOST_WAVE=32, the same binary
with the change off and on: 14,065 -> 14,087 vertex and pixel programs
validated, 70 -> 45 programs with the mixed-mode error, emitted counts
unchanged. VICTORY_FIX_HARMONIZE=0 and VICTORY_FIX_MIXED=0 turn the two
parts off.
Four unit tests for harmonize_input_rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017rHNfuPpCyeMjHxWTEyhiQ
|
Offline check on the retail shader pack: +22 programs validate and nothing is lost, but #699 validates the same 22 plus 120 more. Setup: RTX 5090, Windows 11.
So on this pack, #699 alone does what this does and more. Details: #699 AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it. |
|
Thanks @JRamos1993, confirmed on my side too, so I'm closing this in favour of #699 by @Praisser. On 310c6eb + #699, I measured the one part of this PR that #699 leaves out on purpose:
#699 leaves no mixed-mode rows on this pack, so AI-assisted (Claude Code, Claude Opus 5.5). |
DXIL gives every element packed into a signature row one interpolation mode, and the validator refuses a pixel program whose row mixes two:
The console's compiler packs pixel inputs by register alone, since its shader code does the interpolation itself. So a row can hold a flat element beside an interpolated one, or an element nothing reads, left at its default mode, beside one that is read another way.
Change
shader::harmonize_input_rows(pixel programs, inShader::finish): an element no code reads takes the mode of the row's read elements. An integer element is only ever made constant. In a row nothing reads, a row that holds an integer becomes constant.Lower::mixed_row: a row read in two modes, or interpolated beside a flat read or an integer element, is declared constant, and its interpolations weigh the vertices withSV_Barycentrics. That is the existing path for rows read per vertex (Lower::per_vertex). Rows that use a single mode are untouched.VICTORY_FIX_HARMONIZE=0andVICTORY_FIX_MIXED=0turn the two parts off, for comparisons.Measurements
victory translate --validateover the retail shader pack withVICTORY_HOST_WAVE=32on 310c6eb, using the same binary with the change off and on:Three programs move from the mixed-mode error to the existing "Program Input Signature does not match" error, so they still fail validation. The remaining 45 were not looked into individually.
Testing
emit::shader::row_tests).cargo test -p victory-shadergives 218 passed, 0 failed.AI-assisted (Claude Code, Claude Opus 5.5). Counts only; no game data attached.
🤖 Generated with Claude Code