Repository navigation
d3d12: recover a mesh pixel program's literal samplers under a root with no static samplers - #291
Merged
brcly merged 2 commits intoNov 27, 2026
Conversation
…ith no static samplers A console pixel program builds its samplers from literal words, so a title's root can leave them out entirely. Against a root with no static samplers the translation reads each literal state from a private sampler (space 32765). The vertex and pixel roots add those samplers when they are reflected (inline_sampler::pixel, then inline_sampler::private), but the mesh path asked only inline_sampler::unmatched, which leaves a root without static samplers to those two. The mesh root then lacked the sampler the pixel translation names, and vkd3d-proton rejected the pipeline with "Failed to remap sampler 32765:0" (E_INVALIDARG). When the root the pixel stage is translated against has no static samplers, build the mesh table again with the samplers the vertex and pixel roots recover: the program's one declared sampler at its own register, or else its private samplers from register 0, which is where the translation against a root holding exactly those reads them. As before, the extended root is kept only if the pixel program translates against it.
Add the `mesh-sampler-rootless` scenario. It draws through the `mesh-samplers` mesh program under the two-table root without its static samplers, with two pixel programs that sample with the literal linear state: the `raster-samplers` program, which declares only s0, and the two-sampler program with an empty feature part (SFI0), which shows it reads no sampler from the heap. The provider recovers the first program's sampler at its declared register and the second's at a private register, so the scenario covers both. The provider has to add those samplers to the mesh root it builds, so every texel reads the linear 1.5. Without that the pixel translation names a private sampler the root lacks, the host rejects the pipeline (0x80070057) and the target keeps its clear value. The `lanes-raster-tables` verify suite runs it after `mesh-sampler-single` under the same gate: the mesh pipeline and its one reflected descriptor slot, no stand-in, and no translation of a pixel program without a root. Like the other mesh scenarios it stays out of `all`.
Contributor
|
NVIDIA run of RTX 5090 (10de:2b85), driver 620.70.10 (open kernel module), GE-Proton11-14, Linux 7.0. This was the check only; I didn't do a game run on this branch. |
JeffreyBytes
marked this pull request as ready for review
November 27, 2026 01:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A follow-up to #266 that finishes the literal-sampler part of #227. Two commits:
d3d12: recover a mesh pixel program's literal samplers under a root with no static samplers(15 lines acrossstream.rsandcompute_table.rs). d3d12: give a mesh pipeline's pixel stage the literal samplers its root leaves out #266 appends a mesh pixel program's unmatched literal samplers throughinline_sampler::unmatched, which returns nothing for a root with no static samplers at all and leaves that case toinline_sampler::pixelandinline_sampler::private. The vertex + pixel roots call those two; the mesh path did not. So under such a root the pixel translation still names a private sampler the mesh root lacks, and vkd3d-proton rejects the pipeline:dxil-spirv: Failed to remap sampler 32765:0,0x80070057. The mesh path now uses the same recovery as the vertex + pixel roots, through one shared helper, and as before keeps the extended root only if the pixel program translates against it.lanes: draw through mesh pipelines whose root has no static samplers: the scenariomesh-sampler-rootless.Measured, RX 6700 XT, ProjectScarlett 1.0.2.1 from the Account Picker to the story loading screen, two runs with identical counts. Distinct pipelines, creations in parentheses:
main(8c56463)Failed to remap sampler 32765:0lines0x800700570x80004001/0x80004005Two pixel variants were compiled on the first launch and none on the second. It is a small number in this part of the game; the 121 that remain are pixel programs with no translation yet, not samplers.
Known gaps, the same ones the vertex + pixel path has:
inline_sampler::privatereturns nothing for a pixel container without anSFI0part, so such a program under a root with no static samplers is still not recovered. The block also only runs when a mesh table already exists, as in #266.Not verified: what these two pipelines draw in the game.
Verified on Lanes
python tuxbox.py checkpassed on this branchmesh-sampler-rootlessruns in thelanes-raster-tablessuite aftermesh-sampler-single. It uses themesh-samplersmesh program under the two-table root without its static samplers, with two pixel programs that sample with a literal linear state: theraster-samplersprogram, which declares one sampler (recovered at its own register), and the two-sampler program with an emptySFI0part (recovered at private registers). Everything in it is written by hand for the test; nothing comes from a title.main:lanes-mesh-sampler-rootless FAIL,slot 86 pipeline stage failure #1 0x80070057lanes-mesh-samplers,lanes-mesh-sampler-singleandlanes-raster-samplersGPU, driver and backend: AMD Radeon RX 6700 XT (
1002:73df), Mesa RADV 26.3.1, Linux 7.3.6, Proton backend with GE-Proton11-14. The game runs used theANONONLYpreload from #191.f3ed825(128 gates, comment).The check ran on this branch at
ab644f0.mainhas moved since; the branch still merges cleanly.Checks
The CI commands pass locally: the
tuxbox-dxbctests, the Python tests (414) and thetuxbox-d3d12Windows typecheck. No evidence JSON changes.