d3d12: give a mesh pipeline's pixel stage the literal samplers its root leaves out #266
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/266"
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-26T20:05:11Z.
Summary
The mesh half of #227, on top of #241's
inline_sampler::unmatched. Three commits:d3d12: give a mesh pipeline's pixel stage the literal samplers its root leaves out(38 lines). Onmain, 204 distinct mesh + pixel pipelines in ProjectScarlett 1.0.2.1 fail with0x80070057between the Account Picker and the story loading screen. Their pixel program builds a sampler from literal words that no static sampler of the pipeline root matches. The translation against the root is refused (mimg … not a sampler descriptor (InlineWord)), the mesh path falls back to the root-less translation, and that reads samplers in space 32765, which nothing adds to a mesh pipeline's root:dxil-spirv: Failed to remap sampler 32765:0. When the translation is refused,stream.rsnow builds the mesh table again 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 uses it if the pixel program then translates.lanes: draw through a mesh pipeline whose pixel sampler the root lacks: the scenariomesh-samplers.d3d12: add a mesh pixel program's unmatched literal samplers when it translates too, with the scenariomesh-sampler-single. This is a second fault found while writing the first scenario, and it is onmaintoday: when the pixel program declares exactly one sampler, the translation binds the literal state to that register whatever state the root gives it. The translation succeeds, the pipeline is accepted, and it samples with the root's state instead of the program's. The vertex + pixel roots already append unmatched states every time (#241); this makes the mesh path do the same, keeping the root as declared only if the program does not translate against the extended one.Commit 3 changes the pixel root of mesh pipelines that are accepted today, so it is the one to look at hardest. It is separate so that 1 and 2 can be taken without it.
Measured, RX 6700 XT, ProjectScarlett from the Account Picker to the story loading screen, two or more runs per row with identical counts. Distinct pipelines, creations in parentheses:
main0x800700570x80004001/0x80004005Commit 3 recompiled 7 pixel variants on its first launch and changed no count. The 213 that remain are almost all pixel programs with no translation yet (breakdown in #227).
Not verified: what these pipelines draw in the game. Every AMD run still ends at the page-remap device loss from #191 about two minutes after the picker, so I can't see past the loading screen. A run on NVIDIA past that point would be very welcome, in particular for commit 3.
Verified on Lanes
python tuxbox.py checkpassed on this branchBoth scenarios run in the
lanes-raster-tablessuite afterraster-samplers. Everything in them is written by hand for the test; nothing comes from a title.mesh-samplers: #241's console pixel program (a linear clamp sampler built from literal words), declaring two samplers that the root has as point-filtered statics. The mesh program is a console container with records only (its code is ones_endpgm); its records name a root constant at another register than the root does, so the provider builds a mesh table. Its translation is a prepared desktop mesh shader,mesh_samplers.hlsl, a fullscreen triangle. Every texel must read the linear value.main:lanes-selftest FAIL mesh-samplers: create pipeline from console raster programs failed: 0x80070057lanes-selftest PASS pci=1002:73df scenario=mesh-samplers passed=1mesh-sampler-single: the same, with onlys0declared and a point-filtereds0in the root.mainand with commits 1 and 2:texel 0,0 is 1: point-filtered by the root's s0, not the program's literal linear stateGPU, 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.c6a4887(114 gates, comment).The check ran on this branch at
facfaab.mainhas moved since; nothing merged after that touches these files.Checks
The CI commands pass locally:
tuxbox-dxbc68 tests, shader compiler 371, and thetuxbox-d3d12Windows typecheck. No evidence JSON changes.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-26T20:49:33Z.
NVIDIA run of
c6a4887(this PR's head onfacfaab): fullpython tuxbox.py check --adapter 10de:2b85 --proton … --prefix … --windows-dxc …passed, 114 gates, includinglanes-mesh-samplersandlanes-mesh-sampler-single.I'll do a ProjectScarlett run past the loading screen on this branch after my baseline runs on main, and post what the mesh pipelines draw.
Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T21:01:10Z.
Independent NVIDIA verification of
c6a4887(unmodified PR head): RTX 4080 (10de:2704), GE-Proton11-14, Linux. Built the shader compiler, provider and Lanes locally; all six non-GPU groups passed, then 12/12 selected Lanes checks passed with null pipelines disabled, including lanes-raster-tables, lanes-raster-samplers, lanes-mesh-samplers and lanes-mesh-sampler-single. Used an isolated fixture prefix and private headless display. No game capture or retail assets were used. This confirms the synthetic sampler scenarios on NVIDIA in addition to the reported AMD run; not a new game replay or full translator suite.