Skip to content

d3d12: mesh pipelines are rejected when the pixel program's literal sampler is missing from the root (204 in ProjectScarlett) #227

Done

Description

@JeffreyBytes

On main (d1112f9), ProjectScarlett 1.0.2.1 has 417 distinct mesh + pixel pipelines rejected with 0x80070057 between 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

pipelines (creations) cause
204 (447) The pixel program uses a literal sampler state that no static sampler of the pipeline root matches. Details below.
210 (480) The pixel program has no translation at all (lane operations 78, PS attribute with no signature register 40, v128 spill 48, dynamic soffset 19, cube LOD clamp 18, other 7). The console pixel shader is then used and fails vkd3d_validate_mesh_shader_io_signatures. Not part of this claim.
3 (3) Not explained yet.

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.

  1. The translation against the pipeline root is refused: mimg … not a sampler descriptor (InlineWord).
  2. The mesh path falls back to the root-less translation, which reads its samplers from space 32765.
  3. Nothing adds those private samplers to a mesh pipeline's root, so vkd3d-proton rejects the pipeline: dxil-spirv: Failed to remap sampler 32765:0.

The vertex + pixel path already recovers from this by appending private static samplers (missing_literal_samplers in compute_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: 0x80070057 rejections 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

  • A Lanes scenario that fails without the change. So far there is only a unit test.
  • One design point I'd like an opinion on: the translator keys a sampler by its register alone, so the private samplers are placed on registers above every sampler register the root or the program names. With plain numbering from 0, 43 of the 126 programs refuse with "overlaps another space". If keying by register and space in the translator is preferred, say so and I'll look at that instead.
  • I can't judge the picture: every AMD run still ends at the page-remap device loss from d3d12: buffer-remap regression control fails on RADV, with host memory imports refused #191 a couple of minutes in. A check on NVIDIA past the loading screen would be welcome once the PR is up.

Activity

  1. NickStallman commented on Nov 26, 2026

    @NickStallman
    Contributor

    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 on main before #216; it hasn't had a full GPU check yet).

    • dxbc::inline_sampler::unmatched lists each literal state that no static sampler visible to the stage has.
    • Those states go at registers of the private space 32765, after every sampler register the root uses. That's the same placement you describe, and I picked it for the same "overlaps another space" reason.
    • The reflected compute root and the multi-table raster root (after omitted) append them. xshader is unchanged.
    • In our cache, that group was the largest refusal: 452 requests with sN not a sampler descriptor (Some(InlineWord(N))), mostly programs that index the heap, which d3d12: restore static samplers a multi-table raster root leaves out #174 skips.

    Two options:

    • If the helper is useful for mesh_table::reflected, take it, and I'll open the compute/raster part separately on top of yours.
    • Or I open mine first and you build on it. Whichever you prefer.

    Once your PR is up, I can run it on NVIDIA past the loading screen (RTX 5090, GE-Proton11-14).

  2. JeffreyBytes commented on Nov 26, 2026

    @JeffreyBytes
    ContributorAuthor

    Thanks, that's good timing. I fetched bfc1d7c and compared: your inline_sampler::unmatched and 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.

    • Your helper is the more general one (it takes the stage and reads the program's own sites), and your change covers the larger group. Mine only needs a caller in mesh_table::reflected plus the retry in stream.rs.
    • I'll drop my copy of the helper and rebase onto your branch now, so the mesh PR can follow as soon as yours is up. One thing I'll check while doing that: mine also keeps the private registers above the sampler registers the pixel program itself declares, not only those the root uses. If the 126 mesh programs need that, I'll raise it on your PR instead of working around it.
    • I still owe a Lanes scenario for the mesh path and will add it to my PR.

    I can run your branch on AMD in the meantime (RX 6700 XT, RADV 26.3.1): tuxbox.py check and the ProjectScarlett failure counts before and after. And yes please to the NVIDIA run past the loading screen once the mesh PR is up.

  3. NickStallman commented on Nov 26, 2026

    @NickStallman
    Contributor

    Sounds good. I'm rebasing it onto current main now: #216 added missing_literal_samplers for 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.

  4. JeffreyBytes commented on Nov 26, 2026

    @JeffreyBytes
    ContributorAuthor

    AMD numbers for both parts together. I cherry-picked bfc1d7c onto main (c6ce497) and put the mesh change on top of it, using your unmatched as 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:

    kind main your commit + mesh commit
    mesh + pixel 0x80070057 417 (930) 213 (483)
    vertex + pixel stand-in 179 (346) 48 (75)
    compute stand-in, driver compile failed 127 112
    compute stand-in, not translated 136 136
    mesh + pixel 0x80004001 / 0x80004005 184 / 29 184 / 29

    The 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.rs conflicts with ProjectScarlett start menu: compute roots, faster compiles, watchdog pause #216 in two places. In the compute root, main now has else if flags & 0x800 == 0 { missing_literal_samplers }; I kept that and fall back to unmatched when it returns nothing. In the sampler conversion I kept main's static_sampler helper and its heap_strides block.
    • unmatched returns None for 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.

  5. bbijsterbosch commented on Nov 26, 2026

    @bbijsterbosch
    Contributor

    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.

  6. NickStallman commented on Nov 26, 2026

    @NickStallman
    Contributor

    Opened as #241, rebased onto 3b8a220. Both vendors pass the full check, and there's a Lanes scenario (raster-samplers) that fails on main. 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.

  7. JeffreyBytes commented on Nov 27, 2026

    @JeffreyBytes
    ContributorAuthor

    Status after #266 and today's translator merges, on the RX 6700 XT (picker to story loading, main at 8c56463): mesh+pixel pipelines failing with 0x80070057 are 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.

  8. JeffreyBytes commented on Nov 27, 2026

    @JeffreyBytes
    ContributorAuthor

    #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:0 lines are gone between the picker and the story loading screen, and the 121 mesh + pixel pipelines that still fail with 0x80070057 there 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 SFI0 part under a root with no static samplers is not recovered. I haven't seen it in the title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions