Shader: fix DXIL signature ordering for packed semantics #112

Open
avt0m4t48 wants to merge 1 commit from upstream-pr/112 into main
avt0m4t48 commented 2026-11-24 21:34:42 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-24T21:34:42Z.


Refs #53. The DXC container writer orders signature records by stream, register, and semantic-name offset. VIctory emits stream zero and was using component column as the register tie-breaker. Use the already-computed name offset so packed semantics serialize in the order the validator expects. DXC signature writer

The regression packs two semantics in one register in an order that differs from both their component columns and their alphabetical order. It checks input and output records and verifies their masks. The test fails with the old comparator. With the fix, the shader crate's library suite passed 171 tests with two ignored.

A separate, source-built pixel shader reproduced Container part 'Program Input Signature' does not match expected for module with Linux dxv. Re-emitting it with the comparator change passed validation. The retail shader from #53 and its Windows pipeline were not rerun.

cargo test --locked -p victory-shader signature_sorts_packed_registers_by_semantic_name_offset
cargo test --locked -p victory-shader --lib

AI-assisted using Codex. Source-built inputs only.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6591871375 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/112). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-24T21:34:42Z. --- Refs #53. The DXC container writer orders signature records by stream, register, and semantic-name offset. VIctory emits stream zero and was using component column as the register tie-breaker. Use the already-computed name offset so packed semantics serialize in the order the validator expects. [DXC signature writer](https://github.com/microsoft/DirectXShaderCompiler/blob/main/lib/DxilContainer/DxilContainerAssembler.cpp#L209-L216) The regression packs two semantics in one register in an order that differs from both their component columns and their alphabetical order. It checks input and output records and verifies their masks. The test fails with the old comparator. With the fix, the shader crate's library suite passed 171 tests with two ignored. A separate, source-built pixel shader reproduced `Container part 'Program Input Signature' does not match expected for module` with Linux `dxv`. Re-emitting it with the comparator change passed validation. The retail shader from #53 and its Windows pipeline were not rerun. ```sh cargo test --locked -p victory-shader signature_sorts_packed_registers_by_semantic_name_offset cargo test --locked -p victory-shader --lib ``` AI-assisted using Codex. Source-built inputs only.
arminkhaleghirod commented 2026-11-24 23:09:35 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by arminkhaleghirod on 2026-11-24T22:23:47Z.


Merged onto main 90228a7 and ran victory translate --validate over the full title (26,148 programs) on Windows 11 / RTX 4080.

Clears the 39 Program Output Signature and 33 Program Input Signature mismatches. On main those 72 programs then fall into the blanket PSV mismatch (17,359 → 17,431), so the gain only shows on top of #61. #124, #110 and #112 give identical counts here, so they look like they overlap.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7146176885 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/112#issuecomment-7146176885). Originally posted by [arminkhaleghirod](https://github.com/arminkhaleghirod) on 2026-11-24T22:23:47Z. --- Merged onto main 90228a7 and ran `victory translate --validate` over the full title (26,148 programs) on Windows 11 / RTX 4080. Clears the 39 `Program Output Signature` and 33 `Program Input Signature` mismatches. On main those 72 programs then fall into the blanket PSV mismatch (17,359 → 17,431), so the gain only shows on top of #61. #124, #110 and #112 give identical counts here, so they look like they overlap.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/112:upstream-pr/112'
git switch 'upstream-pr/112'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/112'
git switch 'upstream-pr/112'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/112'
git switch 'upstream-pr/112'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/112'
git switch 'main'
git merge --squash 'upstream-pr/112'
git switch 'main'
git merge --ff-only 'upstream-pr/112'
git switch 'main'
git merge 'upstream-pr/112'
git push origin 'main'
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
fxceless/victory-fork!112
No description provided.