d3d12: mesh pipelines are rejected when the pixel program's literal sampler is missing from the root (204 in ProjectScarlett) #227
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/brcly--TuxBox#227
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@JeffreyBytes on GitHub · 2026-11-26 12:47 UTC · original
On
main(d1112f9), ProjectScarlett 1.0.2.1 has 417 distinct mesh + pixel pipelines rejected with0x80070057between the Account Picker and the story loading screen (RX 6700 XT, RADV 26.3.1, GE-Proton11-14; the counts are identical run to run). I traced what they are. About half have one cause in the runtime, which I'm working on. I'm claiming that half here so nobody duplicates it.What the 417 are
soffset19, cube LOD clamp 18, other 7). The console pixel shader is then used and failsvkd3d_validate_mesh_shader_io_signatures. Not part of this claim.Attribution is from the pipeline failure record joined with the shader cache's refusal reasons and the recorded root signatures, not from the log: pipeline creation runs on a worker thread, so vkd3d's messages don't line up with TuxBox's.
The 204
The console builds a sampler from literal words, so a title can pair a pixel program with a root that doesn't hold that state. In all 204 the root has a static sampler at the register the program declares, but in a different state (border, linear), while the program builds an anisotropic wrap sampler from words.
mimg … not a sampler descriptor (InlineWord).dxil-spirv: Failed to remap sampler 32765:0.The vertex + pixel path already recovers from this by appending private static samplers (
missing_literal_samplersincompute_table.rs, extended in #174). The mesh path (mesh_table::reflected) copies the title's static samplers and adds none.The 204 pipelines come from 126 distinct pixel programs, each with one to three unmatched states.
What I have
A local change that, only when the pixel translation against the root is refused, rebuilds the mesh table with the unmatched literal states appended as private static samplers, to both the host root and the root the pixel stage is translated against, and keeps the result only if the retry translates. Pipelines that translate today are untouched.
On the RX 6700 XT, two runs:
0x80070057rejections go from 417 to 213 distinct (930 to 483 creations), 126 new pixel variants are compiled, and no other failure count changes.Before I open the PR
@NickStallman on GitHub · 2026-11-26 12:53 UTC · original
Thanks for claiming the mesh half. To avoid duplicate work: I have an unopened branch that does the same thing for the other root kinds,
NickStallman:fix/xshader-inline-literal-samplers(bfc1d7c, based onmainbefore #216; it hasn't had a full GPUcheckyet).dxbc::inline_sampler::unmatchedlists each literal state that no static sampler visible to the stage has.omitted) append them. xshader is unchanged.sN not a sampler descriptor (Some(InlineWord(N))), mostly programs that index the heap, which #174 skips.Two options:
mesh_table::reflected, take it, and I'll open the compute/raster part separately on top of yours.Once your PR is up, I can run it on NVIDIA past the loading screen (RTX 5090, GE-Proton11-14).
@JeffreyBytes on GitHub · 2026-11-26 13:11 UTC · original
Thanks, that's good timing. I fetched
bfc1d7cand compared: yourinline_sampler::unmatchedand mine are the same idea with the same placement, down to the name, so there should only be one.I'd go with your second option: please open yours first, and I'll build the mesh part on it.
mesh_table::reflectedplus the retry instream.rs.I can run your branch on AMD in the meantime (RX 6700 XT, RADV 26.3.1):
tuxbox.py checkand the ProjectScarlett failure counts before and after. And yes please to the NVIDIA run past the loading screen once the mesh PR is up.@NickStallman on GitHub · 2026-11-26 13:23 UTC · original
Sounds good. I'm rebasing it onto current
mainnow: #216 addedmissing_literal_samplersfor roots without 0x800, so the two need reconciling. Then the AMD and NVIDIA checks, and I'll open the PR and link it here. If the 126 mesh programs need the registers kept above the pixel program's own declared sampler registers, please raise it on the PR.@JeffreyBytes on GitHub · 2026-11-26 13:38 UTC · original
AMD numbers for both parts together. I cherry-picked
bfc1d7contomain(c6ce497) and put the mesh change on top of it, using yourunmatchedas is. ProjectScarlett from the Account Picker to the story loading screen, RX 6700 XT, RADV 26.3.1, GE-Proton11-14, three runs with identical counts. Distinct pipelines, creations in parentheses:main0x800700570x80004001/0x80004005The mesh number is the same as with my own helper, so yours covers it: all 126 pixel programs behind those pipelines translate, compile, and use only registers the extended root has. Your numbering differs from mine in 54 of them and none fail, so I have nothing to ask for on your side. The 131 vertex + pixel stand-ins and 15 compute failures that go away are from your commit alone.
Two notes for when you rebase onto
main:compute_table.rsconflicts with #216 in two places. In the compute root,mainnow haselse if flags & 0x800 == 0 { missing_literal_samplers }; I kept that and fall back tounmatchedwhen it returns nothing. In the sampler conversion I keptmain'sstatic_samplerhelper and itsheap_stridesblock.unmatchedreturnsNonefor a root with no static samplers, so the mesh retry skips such pipelines. None of the 204 are like that (they have 12 to 22), so it doesn't matter here.On the Lanes scenario I promised: the mesh path only runs for a console mesh program, and nothing in the repo can produce one by hand (the translator accepts them only with their full launch and export code). The closest automated check would be a records-only console mesh container with a prepared replacement, plus a hand-written console pixel program with literal sampler words, which is a few hundred lines of fixture. I'll say that in the PR and leave it to @brcly whether it is wanted.
The mesh commit is ready to go up as soon as your PR is open.
@bbijsterbosch on GitHub · 2026-11-26 13:52 UTC · original
Hi guys, if you want to continue on shader compilition, maybe an idea that i start on shader and pipeline performance? Seems to me everything is way to slow to run the game atm. Or maybe its my hardware. Let me know what you think.