d3d12: mesh pipelines are rejected when the pixel program's literal sampler is missing from the root (204 in ProjectScarlett) #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?
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-26T12:47:21Z.
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
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-26T12:53:15Z.
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).
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-26T13:11:21Z.
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.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-26T13:23:25Z.
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.Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-26T13:38:02Z.
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.
Imported from brcly/TuxBox. Originally posted by bbijsterbosch on 2026-11-26T13:52:32Z.
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.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-26T15:33:53Z.
Opened as #241, rebased onto
3b8a220. Both vendors pass the full check, and there's a Lanes scenario (raster-samplers) that fails onmain. The registers sit above every sampler register the root uses; if the mesh programs also need them above the pixel program's own declared registers, a comment on #241 is the best place for it.Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-27T00:40:37Z.
Status after #266 and today's translator merges, on the RX 6700 XT (picker to story loading,
mainat8c56463): mesh+pixel pipelines failing with0x80070057are down from 417 to 123.I classified the 195 that were left at
6ce0aac: all but three were pixel programs the translator refuses outright (lane reads with a non-constant index, a register used as both lane spill area and vector, attributes without a signature register, dynamic scalar-load offsets), not samplers. Two are still a literal-sampler case, where the root has no static samplers at all.So this issue is close to done; I'll look at those two and then close it.
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-27T02:10:18Z.
#291 is merged, which covers the last literal-sampler case I could find (a root with no static samplers). On the RX 6700 XT the
Failed to remap sampler 32765:0lines are gone between the picker and the story loading screen, and the 121 mesh + pixel pipelines that still fail with0x80070057there are not sampler cases: 120 have a pixel program the translator refuses, and one translates on both stages and is still rejected, cause not found yet.Closing this; if a literal-sampler case turns up further into the game it can get its own issue. Thanks @NickStallman for #241 and the NVIDIA runs.
One known gap remains, shared with the vertex + pixel path: a pixel container with no
SFI0part under a root with no static samplers is not recovered. I haven't seen it in the title.