Repository navigation
Conversation
Dukestar69
approved these changes
Nov 26, 2026
Dukestar69
left a comment
There was a problem hiding this comment.
Reviewed the diff and verified locally on Windows 11 x64 (dxil.dll validation enabled):
- Appending each non-empty arbitrary semantic name to the PSV0 string table (while keeping empty names at offset 0) matches DXC's exact PSV0 output and removes the linear
find()scan. cargo test -p victory-shader --lib emit::container:: -- --test-threads=1: 2 passed, 0 failed (includingpsv_appends_repeated_semantic_names_like_dxc).cargo test -p victory-shader --lib emit::tests:: -- --test-threads=1: 17 passed, 0 failed.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1945 (the writer half).
What
container::psvlooked a semantic name up in the string table before adding it, so a name used by two elements (TEXCOORDon an input and on an output) was written once and both elements pointed at it. Now every element with an arbitrary semantic and a non-empty name appends its own entry; system values and empty names still point at offset 0.findhas no caller left and is removed.container.rsonly;lower.rsis untouched.Why
DXC does not share entries.
SetPSVSigElementappends the name for each arbitrary element without searching (source). Validators before 1.8 rebuild the whole part from the module andmemcmpit (v1.6.2112, v1.7.2308), so a shared entry givesContainer part 'Pipeline State Validation' does not match expected for module. From 1.8 the check is by content and accepts both layouts, which is why CI never showed it. #1945 has the numbers for the validators that do reject it.Evidence
dxc.exe1.9.2602.17,-T vs_6_6 -E main -validator-version 1.6, a vertex shader withPOSITION,TEXCOORD0in andSV_Position,TEXCOORD0out: the string table is\0POSITION\0TEXCOORD\0TEXCOORD\0and the fourth element's name offset is0x13. The new testpsv_appends_repeated_semantic_names_like_dxccompares the first 164 bytes ofpsv()(everything before the input-to-output table) with that output.repository_passes_policy ... ok.NORMAL,BINORMAL, threeTEXCOORDandCOLOR; a geometry shader with twoTEXCOORDin and out; a vertex shader withBINORMAL,NORMAL,WORLD_COLOR,COLORin andNORMALout. In all three the table is one entry per named element, in element order, nothing shared.victory-shaderon three adapters, each one test up on unmodified63bcca4with the same tests failing as there: WARP 299 passed, 4 failed (298 and 4 before); AMD integrated Radeon 296 and 7 (295 and 7); NVIDIA RTX 2060 300 and 3 (299 and 3). The validator on this machine is the 1.9 one, so this shows the new layout is accepted, not that the old one was refused.Other pull requests
main; the part about the string table is not inmain(63bcca4still callsfind). The fork has it as Shaders: write every PSV0 semantic name again, as DXC does (fixes #12) fxceless/victory-fork#61. The idea is theirs; this is the one change with a test against DXC's bytes.NORMALinsideBINORMAL); with one entry per element there is no lookup, so that case cannot occur either. Its testpsv_string_table_matches_whole_entriesexpects the outputNORMALat offset 10, shared with the input; DXC, for that signature, writes\0BINORMAL\0NORMAL\0WORLD_COLOR\0COLOR\0NORMAL\0and puts it at 35. If Shaders: match whole entries in the PSV0 string table #3088 goes in first I will rebase this onto it. I tried that locally on its headd7a9515: withfind_stringremoved and that one test's table and offset set to DXC's, its two tests and the new one pass.Not checked
psv()sets every bit on purpose (Shaders: compute exact dx.viewIdState and PSV0 input-output dependencies #1985).Synthetic tests only; no game files.
— Gemini & Fable