Shaders: emit canonical system-value names and preserve in-row order in ISG1/OSG1 (#53) #110
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/110"
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?
Imported from fxceless/victory-fork. Originally posted by adritoyalser on 2026-11-24T21:33:21Z.
Addresses #53.
Problem
dxil.dllvalidatesISG1/OSG1/PSG1by regenerating the signature container part from the DXIL module and comparing it byte-for-byte against the emitted part. Two mismatches incontainer::signaturecausedContainer part 'Program Input Signature' does not match expected for module.(or'Program Output Signature') even though D3D12 drivers still accepted the shader and created pipelines:container::signaturewroteSigElement::nameverbatim (copied from the console shader's signature). When a shader declared e.g.SV_POSITION,SV_ISFRONTFACE,SV_PRIMITIVEID,SV_BARYCENTRICS, orSV_TARGETwith uppercase/non-canonical casing,dxil.dllexpected DXIL's canonical semantic name (SV_Position,SV_IsFrontFace,SV_PrimitiveID,SV_Barycentrics,SV_Target, etc.) and failed validation, while D3D12 matched semantic names case-insensitively.container::signaturesorted rows by(row, col), whereasdxil.dllsorts stably byrowonly and preserves element order for elements sharing a register row. Two elements sharing a row in reverse column order (e.g.col 2beforecol 0) failedISG1validation.Fix
SigElement::canonical_name()incrates/victory-shader/src/emit/container.rsreturning DXIL's canonical semantic name for all supported system values (kind != 0), keepingself.namefor arbitrary semantics (kind == 0).ISG1/OSG1/PSG1rows stably byrowonly (elements[i].row.unwrap_or(u32::MAX)).crates/victory-shader/src/emit/mod.rsvalidated againstdxil.dll:non_canonical_system_value_names_validate_in_isg1_and_osg1shared_row_elements_keep_element_order_in_isg1Verification
cargo clippy -p victory-shader --all-targets --locked -- -D warnings— cleancargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings— cleancargo test -p victory-shader --lib --locked emit::tests— 12 passed, 0 failed (validated againstdxil.dll10.0.26100.0)cargo test -p victory-shader --lib --locked emit::container::tests— 1 passed, 0 failedImported from fxceless/victory-fork. Originally posted by arminkhaleghirod on 2026-11-24T22:23:45Z.
Merged onto main
90228a7and ranvictory translate --validateover the full title (26,148 programs) on Windows 11 / RTX 4080.Clears the 39
Program Output Signatureand 33Program Input Signaturemismatches. 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.Imported from fxceless/victory-fork. Originally posted by adritoyalser on 2026-11-25T10:48:55Z.
Added unallocated-column handling (
effective_col= 0 whenrowisNone, e.g.SV_Depthwith sentinelcol = 0xff) plus a unit test (container::tests::unallocated_signature_element_uses_column_zero) in009b6cfso #110 also covers the unallocated-column gap noted in #848.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.