d3d12: restore static samplers a multi-table raster root leaves out #174
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/brcly--TuxBox!174
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/174/head"
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-25 14:59 UTC · original
JeffreyBytes:feat/omitted-static-samplers→main· +153 −0 · 3 files · 1 commits · merged 2026-11-25 18:00 UTCSummary
Draft, opened early so nobody duplicates it. Follow-up to #168, which lists "guest root kept: pixel stage untranslated" among the cases it leaves.
The console compiles a static sampler into the program as four literal words. ProjectScarlett creates many raster pipelines with a root signature that lacks a sampler its pixel shader declares in PSV and FSSM, most often a shadow comparison sampler (
[0x30b6, 0xc00000, 0x18500000, 0x80000000]: border, border, clamp,LESS_EQUAL, opaque white). The translator finds no static sampler in the root for that state and refuses the shader:This change gives the root the sampler back:
inline_sampler::omittedreturns, for a pixel shader and a root, the literal sampler states that no static sampler of the root carries. Each takes a sampler register the shader declares and the root does not cover. It returns nothing when PSV and FSSM disagree about the shader's static samplers, when the shader uses the sampler heap, when the root has no static samplers (the existingpixelandprivaterecoveries own that case), or when there are more missing states than free declared registers.The translator is unchanged. It is handed the reflected root, so it matches the literal state to the appended sampler the way it matches any other.
Results on ProjectScarlett
Offline, over 14,655 locally recorded requests (measured before the module split; the change is the same):
omittedreturns samplers for 269 pixel shaders (139 with one, 130 with two). All 269 were refused before and translate once the samplers are in the root. It returns nothing for every request that already translated.In the game, RX 6700 XT on RADV (Mesa 26.3.1), Intel i5-12600K, Proton Experimental, offline. Each build got its own
--prepare-onlypass and a warm-up run, then a run stopped at 300 s. Counts are from the pipeline failure file;mainis7b22d71.mainNo failed presents in any run, and the present rate is the same across builds (about 300 to 340 per 10 s). #173 alone gives 202 stand-ins; the two together reach 65 because some pipelines need both stages fixed before either can use the reflected root.
Not covered: 38 recorded shaders are still refused for a sampler state. In those the root does carry the declared register, with a different state from the shader's literal (for example linear where the literal is 8x anisotropic). Which side should win there is a separate question.
Verified on Lanes
python tuxbox.py checkpassed on this branchNot run yet; this is why the pull request is a draft.
Checks
Run on this branch, rebased onto
7b22d71(after the test and module split):python -m unittest discover -s tests: 348 testsdxbcwithnative-bindings: 62, including the newa_static_sampler_the_root_leaves_out_takes_its_declared_registerxg-layout: 14cargo check --target x86_64-pc-windows-msvc -p tuxbox-d3d12No evidence JSON changed.
The console compiles a static sampler into the program, so a title can create a pipeline with a root signature that lacks a sampler its pixel shader declares. The translation then finds no sampler for that literal state and refuses the shader ("not a sampler descriptor"). inline_sampler::omitted returns those states for a pixel shader: literal states no static sampler of the root carries, each given a sampler register the shader declares in PSV and FSSM and the root does not cover. The reflected root of a multi-table raster pipeline appends them to the root's own samplers, and the translation, which reads that root, binds them like any other static sampler.