Shaders: PSV0 and signatures laid out as the validator expects #1208

Closed
powplusplus wants to merge 1 commit from upstream-pr/1208 into main
powplusplus commented 2026-11-24 16:25:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by powplusplus on 2026-11-24T16:25:59Z.


On ffe310e, dxil.dll rejects most emitted shaders with "Container part 'Pipeline State Validation' does not match expected for module" (15,054 programs in shaders.rpf), plus a few dozen signature mismatches.

  • PSV0 writes one string per arbitrary semantic element. It shared one string between elements with the same name, which is not what the validator builds.
  • ISG1 and OSG1 sort elements by row only, so elements packed into one row keep their order. #306 and #1022 change the same sort; I can drop it here if one of them lands first.
  • Interpolation modes come from the console container's PSV0 when it has one, falling back to the current defaults. That clears the "interpolation mode that differs from another element packed into the same row" errors. Related to #554, which splits such rows instead.

translate --validate over shaders.rpf, nothing else changes in what emits:

main this
VS + PS validated 2,680 / 12,231 12,231 / 12,231
CS validated 1,441 / 1,441 1,441 / 1,441
MS validated 2,573 / 8,214 8,161 / 8,214

The 53 mesh shaders left exceed the validator's 32 KB vertex plus primitive output limit.

Tested: clippy (default and all features), cargo test -p victory-shader with three new tests.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6586470334 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1208). Originally posted by [powplusplus](https://github.com/powplusplus) on 2026-11-24T16:25:59Z. --- On `ffe310e`, dxil.dll rejects most emitted shaders with "Container part 'Pipeline State Validation' does not match expected for module" (15,054 programs in shaders.rpf), plus a few dozen signature mismatches. - PSV0 writes one string per arbitrary semantic element. It shared one string between elements with the same name, which is not what the validator builds. - ISG1 and OSG1 sort elements by row only, so elements packed into one row keep their order. #306 and #1022 change the same sort; I can drop it here if one of them lands first. - Interpolation modes come from the console container's PSV0 when it has one, falling back to the current defaults. That clears the "interpolation mode that differs from another element packed into the same row" errors. Related to #554, which splits such rows instead. `translate --validate` over shaders.rpf, nothing else changes in what emits: | | main | this | |---|---:|---:| | VS + PS validated | 2,680 / 12,231 | 12,231 / 12,231 | | CS validated | 1,441 / 1,441 | 1,441 / 1,441 | | MS validated | 2,573 / 8,214 | 8,161 / 8,214 | The 53 mesh shaders left exceed the validator's 32 KB vertex plus primitive output limit. Tested: clippy (default and all features), `cargo test -p victory-shader` with three new tests.
Zipettte commented 2026-11-24 18:06:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T18:00:04Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 084d8d2: cargo test -p victory-shader passes, 123 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140012081 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1208#issuecomment-7140012081). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T18:00:04Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 084d8d2: `cargo test -p victory-shader` passes, 123 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
upstream-sync closed this pull request 2026-11-25 01:05:56 +00:00
Marvisak commented 2026-11-25 01:08:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:34:57Z.


Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

Superseded by main: signature rows are already sorted by register only and one interpolation mode per row is already enforced (container::same_mode_per_row), and every emitted VS/PS validates. Its remaining change, unshared PSV0 strings, departs from the layout main validates with; its test's Psv literal also lacks main's gs field.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148661878 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1208#issuecomment-7148661878). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:34:57Z. --- Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. Superseded by main: signature rows are already sorted by register only and one interpolation mode per row is already enforced (container::same_mode_per_row), and every emitted VS/PS validates. Its remaining change, unshared PSV0 strings, departs from the layout main validates with; its test's Psv literal also lacks main's gs field. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!1208
No description provided.