Shaders: one interpolation mode per signature row #554
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!554
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/554/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?
@SAitken91 on GitHub · 2026-11-24 04:49 UTC · original
SAitken91:shader/separate-interpolation-rows→main· +74 −0 · 2 files · 1 commits · closed without mergingThe console packs signature elements of different interpolation modes into one row, for example a constant
SV_IsFrontFaceor uint beside a linearTEXCOORD. The DXIL validator rejects this with "signature element ... has interpolation mode that differs from another element packed into the same row".Change
container::separate_interpolation, run on the inputs and outputs inShader::finishbefore any signature is written. The first mode seen in a row keeps the row. Each later mode moves to a new free row, and that row's elements of the same mode share it.Results
victory translate --validate shaders.rpf, before → after:No interpolation-row errors remain. A few programs now report the "Container part 'Program Input/Output Signature' does not match" errors already in the list, which the packing error had hidden.
Testing
cargo test -p victory-shader: 70 passed, including the newrows_of_mixed_interpolation_are_separated. Clippy and rustfmt are clean.This is independent of #539 (64-bit image atomics), and the two can merge in either order.
Written with the help of Claude (AI).
🤖 Generated with Claude Code
@KoLolX3 on GitHub · 2026-11-24 05:32 UTC · original
Check on Linux, not Windows: pass. Head
9152a1beemerged ontomaind2a4bae1f(clean merge).core,formats,game,loader,pe,pipeline,shader): PR93 passed, 7 failed,main92 passed, 7 failed.cargo xwin check --workspace --target x86_64-pc-windows-msvc, coversvictory-gpu,victory-hleand the app): PR ok,mainok.main168.mainhere as well (not this PR): 7 tests invictory-loaderandvictory-pethat parse their own test binary as a PE image, which is an ELF file on Linux.victory-gpu/victory-hletests and the game itself.On: AMD Ryzen 7 5700, 62 GB RAM, Artix Linux 7.3.4-artix1-2, rustc 1.98.1 (the repo's pinned toolchain), cargo-xwin 0.24.1. No game data. Automated check only: the code itself was not reviewed.
@slint6614-dev on GitHub · 2026-11-24 07:47 UTC · original
Measured on the full retail shader pack (26,503 containers) with
victory translate --validate, against maind2a4bae(emitted / validated). Windows 11, dxil.dll from SDK 10.0.26100.cargo test -p victory-shaderpasses on all four.@SAitken91 on GitHub · 2026-11-24 10:46 UTC · original
@alexander-src thank you — that's decisive, and it breaks the premise of this PR ("stages link by semantic"): moving rows in one stage changes
(row, col)andCreateGraphicsPipelineStaterejects the pair, whichtranslate --pipelinescan't see because it pairs the PS with a stub VS. Your second table row (VS interp 2 + PS interp 1 at the same row links fine) points to the safer approach #306 takes: keep rows in place and harmonize the mode. I'm converting this to a draft so it isn't merged as is; it would need both stages to derive the same layout, which a per-stagemax(row) + 1can't guarantee.@SAitken91 on GitHub · 2026-11-24 12:42 UTC · original
@catminou4 thanks for the review — note the blocker above, though: @alexander-src showed on an RTX 5090 and WARP that D3D12 rejects VS/PS pairs whose
(row, col)differ (CreateGraphicsPipelineState→E_INVALIDARG). This PR moves rows per stage (next = max(row) + 1in each), so a PS can end up with rows its VS doesn't have, which the validator andtranslate --pipelines(stub VS) can't catch. That's why it's a draft; #306's approach (keep rows, harmonize the mode) avoids it.@SAitken91 on GitHub · 2026-11-24 14:56 UTC · original
Closing in favour of #306, which keeps signature rows in place and harmonizes the interpolation mode instead, so VS/PS (row, col) stay identical and pipelines link (per @alexander-src's RTX 5090/WARP results above). Thanks to everyone who tested and reviewed this.
Pull request closed