Separate signature rows by interpolation mode and rebuild container parts in name order #1160

Open
github-bot wants to merge 3 commits from github-bot/gh-1160 into main AGit
Owner

@⁠superboynick on GitHub · 2026-11-25 22:07 UTC · original
superboynick:fix/signature-rows → main · +147 −19 · 5 files · 3 commits · open

Three shader-emission defects, all invisible unless the census runs with --validate: every program involved already got a pipeline.

1. Signature elements of differing interpolation modes in one row (84 lines).
The emitter kept the container's row assignment and set interpolation modes per element afterwards, so two elements sharing a row could disagree. Elements are now separated by mode after lowering; a program that cannot fit within the 32 rows the format allows is reported unsupported rather than emitted invalid.

2. Container signature parts rebuilt in the wrong order (74 lines).
Both parts were rebuilt from the lowered module but ordered by column rather than by name within each register. Sorting by name matches what the module declares.

3. An array-layer index in the LOD query slot (4 lines).
An array-layer index was passed into the third coordinate of a level-of-detail query with the remaining slots left as they came, which the validator reads as an out-of-bounds coordinate rather than an unused one. Writing undef there clears the error and touches no other coordinate. Affected programs were the three *_AlphaClip pixel shaders.

Measured on the full pack (translate --validate --pipelines --list, dxil.dll 1.9, 32-lane, 26,084 programs):

origin/main this PR interpolation-mode errors 84 0 container signature mismatch 74 0 out of bound coord 4 0 validated vertex and pixel 14088 14199 pipelines created 25607 25607

All 14,199 emitted vertex and pixel programs now validate; the pipeline count is unchanged, so this corrects generated code rather than unlocking draws.

What is left on this host, untouched here: 72 mesh programs whose combined vertex and primitive outputs exceed 32768 components. Their overshoot is small - 128 to 896 components over, with 33 of 71 unique hashes at +256, all in ped-skinning meshes with no primitive outputs at all - which is documented on #854 rather than fixed.

Tests cover the row-separation rule with table-driven cases: 218 passed, 3 ignored.

**@⁠superboynick** on GitHub · 2026-11-25 22:07 UTC · [original](https://github.com/fxceless/victory-fork/pull/1160) `superboynick:fix/signature-rows` → `main` · +147 −19 · 5 files · 3 commits · open Three shader-emission defects, all invisible unless the census runs with `--validate`: every program involved already got a pipeline. **1. Signature elements of differing interpolation modes in one row (84 lines).** The emitter kept the container's row assignment and set interpolation modes per element afterwards, so two elements sharing a row could disagree. Elements are now separated by mode after lowering; a program that cannot fit within the 32 rows the format allows is reported unsupported rather than emitted invalid. **2. Container signature parts rebuilt in the wrong order (74 lines).** Both parts were rebuilt from the lowered module but ordered by column rather than by name within each register. Sorting by name matches what the module declares. **3. An array-layer index in the LOD query slot (4 lines).** An array-layer index was passed into the third coordinate of a level-of-detail query with the remaining slots left as they came, which the validator reads as an out-of-bounds coordinate rather than an unused one. Writing `undef` there clears the error and touches no other coordinate. Affected programs were the three `*_AlphaClip` pixel shaders. **Measured on the full pack** (`translate --validate --pipelines --list`, dxil.dll 1.9, 32-lane, 26,084 programs): ` origin/main this PR interpolation-mode errors 84 0 container signature mismatch 74 0 out of bound coord 4 0 validated vertex and pixel 14088 14199 pipelines created 25607 25607 ` All 14,199 emitted vertex and pixel programs now validate; the pipeline count is unchanged, so this corrects generated code rather than unlocking draws. What is left on this host, untouched here: 72 mesh programs whose combined vertex and primitive outputs exceed 32768 components. Their overshoot is small - 128 to 896 components over, with 33 of 71 unique hashes at +256, all in ped-skinning meshes with no primitive outputs at all - which is documented on #854 rather than fixed. Tests cover the row-separation rule with table-driven cases: 218 passed, 3 ignored.
The validator rejects a signature when two elements packed into the same
row disagree on interpolation mode, and 84 of the 158 validator errors on
the retail pack were exactly that. The emitter kept the container's row
assignment and then set interpolation modes per element, without checking
the two against each other.

Elements are now separated by mode after lowering, so a row only ever
holds one mode. Where no free row remains inside the 32 the format allows,
the program is reported unsupported rather than emitted invalid.

Full pack, validated with dxil.dll 1.9, 32-lane: the interpolation-mode
class goes from 84 occurrences to none, and validated vertex and pixel
programs rise from 14088 to 14135. Pipelines created are unchanged.
The container's Program Input and Output Signature parts were rebuilt from
the lowered module but ordered by column rather than by name, so the
validator reported a mismatch on 80 of the 158 error lines the retail pack
produces. Sorting by name within registers matches what the module says.

Full pack, validated with dxil.dll 1.9, 32-lane, on top of the
interpolation-row change:

  container signature mismatches   80 -> 0
  validated vertex and pixel    14135 -> 14196
  pipelines created             25610 -> 25610 (unchanged)

Remaining validator errors are the 72 mesh programs whose outputs exceed
the limit and 4 out-of-bound coordinate reads.
The validator rejects a coordinate that is out of bounds and not undef.
An array-layer index was being passed into the third coordinate of a level
of detail query while the remaining slots were left as they came, which
the validator reads as an out-of-bounds coordinate rather than an unused
one. Writing undef there instead clears the error on all three programs
that reported it, and touches no other coordinate.

Verified on the three programs by hash: no validator error, all three
pipelines still created.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:58:41 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1160/head:github-bot/gh-1160'
git switch 'github-bot/gh-1160'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1160'
git switch 'github-bot/gh-1160'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1160'
git switch 'github-bot/gh-1160'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1160'
git switch 'main'
git merge --squash 'github-bot/gh-1160'
git switch 'main'
git merge --ff-only 'github-bot/gh-1160'
git switch 'main'
git merge 'github-bot/gh-1160'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.