Shaders: one interpolation mode per pixel input row #722
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!722
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/722/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@KyleS98 on GitHub · 2026-11-25 05:42 UTC · original
KyleS98:fix/pixel-input-row-interpolation→main· +121 −1 · 2 files · 1 commits · closed without mergingDXIL 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=32on310c6eb, 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.310c6eb.AI-assisted (Claude Code, Claude Opus 5.5). Counts only; no game data attached.
🤖 Generated with Claude Code
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 <[email protected]> Claude-Session: https://claude.ai/code/session_017rHNfuPpCyeMjHxWTEyhiQ@JRamos1993 on GitHub · 2026-11-25 05:54 UTC · original
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.
victory translate --validate --listover the title's full shader pack,main310c6ebagainst this head merged onto it. I added a local DXIL hash on each validated line.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.
@KyleS98 on GitHub · 2026-11-25 06:13 UTC · original
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:Lower::mixed_row, which makes a row whose read elements disagree constant and interpolates it by hand. I used the same binary with it off and on,victory translate --validateover the retail pack withVICTORY_HOST_WAVE=32:#699 leaves no mixed-mode rows on this pack, so
mixed_rowhas nothing left to fix, and #699 covers everything this PR did plus the element order and the vertex/mesh outputs.AI-assisted (Claude Code, Claude Opus 5.5).
Pull request closed