Shaders: write every PSV0 semantic name again, as DXC does (fixes #12) #61
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!61
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-61"
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?
@srcamarda on GitHub · 2026-11-24 21:01 UTC · original
srcamarda:fix/mesh-psv-semantic-strings→main· +55 −14 · 1 files · 1 commits · openFixes #12.
Cause
container::psvshared one string-table entry between elements with the same semantic name (it looked the name up in the table before adding it). DXC writes one entry per named arbitrary element, in element order and repeats included; system values and unnamed elements point at offset 0.Validators before 1.8 compare
PSV0byte for byte with the part they would write, so they refused ours with the message from #12:Validator 1.8 (the Windows SDK 10.0.26100 one, which
Validator::default_pathpicks) compares by content and accepts both layouts. That is why the suite never showed it.It is not specific to mesh shaders. Vertex and geometry shaders with repeated names fail the same way: under 1.7,
emit::rect::tests::rectangles_are_drawn_wholeandthe_rectangle_stage_is_a_geometry_shaderfail onmain.How it was checked
Reference shaders compiled with the SDK's
dxc.exe(-validator-version 1.6): a mesh shader withTEXCOORD0/1vertex outputs and aTEXCOORD2primitive output, and a vertex shader with repeatedTEXCOORDs. Then a copy of each with the names merged the waypsvmerged them:Change
findgoes (it could also match the tail of another name,NORMALinsideBINORMAL).psv_names_repeat_as_dxc_writes_themchecks the string table and each element's offset.Before and after
The
PSV0string table and each element's name offset (inputs, then outputs), frompsv()onmainand on this branch, next to what DXC writes for the same signature (SDKdxc.exe10.0.26100,-validator-version 1.6).Pixel shader, colour and depth out (
SV_Position,TEXCOORD0in;SV_Target,SV_Depthout):\0TEXCOORD\0\0\00, 1, 0, 0main\0TEXCOORD\0\0\00, 1, 0, 0\0TEXCOORD\0\0\00, 1, 0, 0No change: both outputs are system values, so they point at offset 0, and no name repeats. This shape was never refused.
Vertex shader with repeated names (
TEXCOORD0,TEXCOORD1in;SV_Position,TEXCOORD0,TEXCOORD1,COLOR0out):\0TEXCOORD\0TEXCOORD\0TEXCOORD\0TEXCOORD\0COLOR\0\01, 10, 0, 19, 28, 37main\0TEXCOORD\0COLOR\01, 1, 0, 1, 1, 10\0TEXCOORD\0TEXCOORD\0TEXCOORD\0TEXCOORD\0COLOR\0\01, 10, 0, 19, 28, 37mainpoints all fourTEXCOORDs at one entry. This branch writes one entry per element, as DXC does, and matches it byte for byte. Validators 1.6 and 1.7 refuse themainlayout.Tests
cargo test -p victory-shader: 211 passed withVICTORY_DXILset to validators 1.6, 1.7 and 1.8. Onmainit is 208 passed / 2 failed under 1.7.cargo test --workspace: all pass.cargo clippy -p victory-shader --all-targets: clean.AI-assisted (Claude Code). No game data used.
🤖 Generated with Claude Code
PSV0 shared one string-table entry between elements with the same semantic name. DXC writes one entry per named arbitrary element, in element order and repeats included. Validators before 1.8 compare the part byte for byte and refused ours ("Container part 'Pipeline State Validation' does not match expected for module"); 1.8 compares by content and took either, which is why the newest SDK never showed it. This is not specific to mesh shaders: vertex and geometry shaders with repeated names failed the same way (the rect tests under 1.7). Fixes #12. Co-Authored-By: Claude Opus 5.5 <[email protected]>@rostaddotcc on GitHub · 2026-11-24 21:16 UTC · original
Verified on a Linux host at
8bac552(CachyOS, RX 7900 XT/RDNA3, x86-64, no Windows target needed for this crate):cargo test -p victory-shader— 171 passed, 0 failed, 2 ignored (1.8 s).cargo xtask policy— 169 files ok.cargo xwin build --release -p victory --target x86_64-pc-windows-msvc— clean.So the shader library this touches is green on a non-Windows platform as well, which matters for #53/#12 being platform-independent: the PSV0 name handling is not in a Windows-only path.
One request: the PR says "one PSV0 name entry per element". Could the description quote what the container emits before/after for a two-element signature with a colour and a depth output? On this side I can only see the byte counts, so a before/after pair in the description is the cheapest way for a reader to check the claim without rebuilding.
@srcamarda on GitHub · 2026-11-24 21:17 UTC · original
Checked against the title's shaders. I ran
victory translate --validateover the title's own shader archive, comparing this branch withmain(4e17478). The 1.7 validator is 1.7.2308; the 1.8 validator is the Windows SDK 10.0.26100 one (1.8.2502.11). Counts only; no game data attached.main+ 1.7main+ 1.8mainhas about 70% of the emitted vertex/pixel and mesh programs refused onPSV0. With this PR none are, and 1.7 accepts the same programs as 1.8.--list), and so are the remaining failures.ISG1/OSG1mismatches;AI-assisted (Claude Code).
@adriaespii on GitHub · 2026-11-24 21:23 UTC · original
Independent test run on commit
8bac552(AMD RDNA4):x86_64-pc-windows-msvc)cargo clippy --workspace --all-targets -- -D warnings: 0 warningscargo test --workspace: 497 passed, 0 failed, 7 ignored (victory-shader: 211 passed, 0 failed, 2 ignored;victory-gpu: 110 passed, 0 failed, 1 ignored)AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.
@arminkhaleghirod on GitHub · 2026-11-24 22:23 UTC · original
Merged onto main
90228a7and ranvictory translate --validateover the full title (26,148 programs) on Windows 11 / RTX 4080.Big one:
Pipeline State Validation does not match(17,359 on main) is gone.With it out of the way, real errors show that it was hiding. The biggest new one: 71 ×
vertex plus primitive output size is greater than 32768. The rest are the known emit failures and the interpolation-mode/signature errors. Since the PSV mismatch hides other PRs' validator results on main, it'd help to land this one first.@DovisLe on GitHub · 2026-11-24 23:43 UTC · original
Tested on a Radeon 860M (RDNA 3.5), Windows 11, with
8bac552merged onto the currentmain(2119b0e). The merge is clean.cargo test -p victory-shader --locked --libwas run under two validators, picked withVICTORY_DXIL:mainmaindxil.dll)On
mainunder 1.7,emit::rect::tests::rectangles_are_drawn_wholeandthe_rectangle_stage_is_a_geometry_shaderfail with #12's message:This matches the PR's table. I didn't test 1.6, and I didn't run any title's shaders: no game files were used.
AI-assisted (Claude).
@srcamarda on GitHub · 2026-11-25 01:59 UTC · original
@rostaddotcc Thanks for checking. I added a "Before and after" section to the description. It compares
psv()onmain, on this branch, and DXC for two signatures.A signature with colour and depth outputs is the same before and after.
SV_TargetandSV_Depthare system values, so their name offset is 0, and nothing repeats. The change only shows when a name repeats. Take a vertex shader withTEXCOORD0/TEXCOORD1in and out:mainpoints all fourTEXCOORDs at one string entry.\0TEXCOORD\0TEXCOORD\0TEXCOORD\0TEXCOORD\0COLOR\0\0with offsets1, 10, 0, 19, 28, 37, which matches DXC byte for byte.AI-assisted (Claude Code). No game data used.
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.