d3d12, dxbc: lay out a mesh pipeline's pixel tables as the pixel program reads them #177
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!177
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/177/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?
@3kynox on GitHub · 2026-11-25 16:37 UTC · original
3kynox:pr-mesh-pixel-layout→main· +247 −8 · 5 files · 1 commits · merged 2026-11-25 17:59 UTCSummary
Follow-up to #157, #158 and #163.
After #163, ProjectScarlett still loses most of its mesh pipelines to
0x80070057: vkd3d-proton refuses the pixel stage withdxil-spirv: Failed to remap <SRV|CBV> <space>:<register>. Onmainat682a0e4that was 2,579 distinct mesh pipelines seven minutes into a run.The cause is the title's root signature. For the pixel stage of these pipelines it does not describe the table the program reads. Like the mesh program, the pixel program carries its own physical layout in its FSSM records. Where the two disagree, the console follows the program: it takes the table's address from a scalar register and reads the slot. The declaration is not consulted.
One of these pipelines, root parameter 1 (visible to all stages, space 1):
t12t69t20t6b0t96b5The program's resource list names
t96andb5in space 1. The root declares neither. The pixel stage is translated against the guest root (#157), so it declares two registers that no parameter of the host root has, and the host refuses the pipeline.This change reads the pixel program's layout the way
MeshLayoutalready reads the mesh program's, and uses it:MeshLayout::from_pixel_shaderreads a pixel program under the same rules as a mesh program. Two rules depend on the stage. A root parameter must be visible to all stages or to the stage being read. A pixel program can hold unordered-access textures (FSSM class0x303, eight words), which become UAV ranges.mirrors, #158) is laid out as the pixel program reads it. If the mesh layout did not rewrite that table, the title's declaration is kept for the mesh stage only.ComputeTable::pixel_root). The translated program and the host root name the same registers at the same slots.A pipeline whose pixel layout agrees with the root, or cannot be read, is built exactly as before: same root, same copies, same translation.
Not handled: a table visible to the pixel stage only, root descriptors and root constants. In the 2,397 pixel programs I captured with their roots, every table that differs is visible to all stages.
#168 does the matching work for vertex/pixel pipelines and brings their stand-ins down. Its table shows the
0x80070057count unchanged (744 and 744). That count is what this pull request is about: in my runs every0x80070057row is a mesh pipeline.Measured on ProjectScarlett
Two unattended offline runs, one after the other, taken before today's merges. Only
d3d12_xs.dlldiffered: it was built frommainat682a0e4for one run and from this change on top of682a0e4for the other. The branch was then rebased onto7b22d71. The code is the same as in the measured build, except that a helper of a few lines instream.rsis now written inline and the two tests moved tosrc/tests/mesh_table.rs. Every other provider, the launcher, the translator binary (TUXBOX_XSHADER) and the prepared shader cache were the same files. Both runs usedTUXBOX_RUNTIME_SHADER_JOBS=8,TUXBOX_TRACE_PRESENT=600andTUXBOX_LOG_TIME=1, left the first screen through an injected key press at about 40 s, and started with the translations of an earlier run in the cache. The counts are distinct pipelines in the run'spipeline-failuresfile.main, 420 s0x800700570x800040010x80004005The branch run got more time because it has more work per pipeline: it compiles the pipelines
maingives up on. The stand-in row is the control. It shows the two runs covered the same part of the title's loading: the branch's 2,759 stand-in pipelines are all amongmain's 2,769.main, with the same code. None is new.main: in 2,349 the pixel layout differs from the root in at least one table. In 225 the pixel stage has no rooted translation, and in 5 the layout cannot be read.Failed to compile shader, vkd3d result -3falls from 13,078 lines to 3,644.This is evidence about pipeline creation only. Both runs were still on the loading screen when they ended, and I have not seen a world frame on this machine yet, so nothing here shows these pipelines drawing. At draw time they take the path #158 added for pixel-only copies: the copy binds the same guest table, now at the program's slots.
Title data stayed on my machine. Only counts and register names are given here.
Verified on Lanes
python tuxbox.py checkpassed on this branch (every step passes except one Lanes scenario that #172 added today,lanes-selftest-descriptor-reclaim. It fails the same way onmainat9ca0060on this host. Details below.)GPU, driver and backend: NVIDIA GeForce RTX 4070 Ti SUPER (
10de:2705), driver 595.112.07, Proton Experimental 11.0-20261112. NixOS, Linux 7.2.11, Intel Core i9-12900K, Hyprland (Wayland).On this commit (on
7b22d71), with--proton,--prefixand--windows-dxc(Microsoft's x64 DXC 1.8.2505.1):63 of the 64 guest checks and all 17 regression cases pass. The one failure:
mainbuilt and run the same way (at9ca0060, the merge of #172) fails that scenario with the same line. The scenario's last step counts on a resident limit of 1,000,000 descriptors.CreateDescriptorHeaptakes the host'sMaxViewDescriptorHeapSizewhen that is larger. I have not read the value this host reports, but withTUXBOX_DESCRIPTOR_HEAP_LIMIT=1000000in the environment the scenario passes onmain, so without the cap the 63 pinned tables fit. #178 fixes the scenario.Before #172 was merged, the same change on
1d821cbpassed every step (63 of 63 guest checks, 17 regression cases).The present checks sampled the private rootful Xwayland that
verifystarts on a Wayland desktop. The host is NixOS, so the command ran inside its FHS environment (steam-run): the regression controls start Proton'swinedirectly, and it needs/lib/ld-linux.so.2.Why there is no Lanes scenario. The existing mesh check (
d3d12-mesh,runtime/d3d12/mesh_guest.cpp) compiles its mesh and pixel shaders from HLSL with DXC. Desktop DXIL has no FSSM records, somesh_table::reflectedreturns before this code for it. The only console program in the tree is the single-instruction compute shader inexamples/lanes/shader_fixture.py. A scenario for this path needs a hand-assembled console mesh program and pixel program whose FSSM records place descriptors in root tables, a root that declares one of those tables differently, and a pipeline stream the translator accepts from end to end. The two new DXBC tests build synthetic FSSM programs for the reading rules instead.Checks
python -m unittest discover -s tests -qcargo testfortools/shader-compiler(303 + 2),tuxbox-dxbcwithnative-bindings(63) andtuxbox-xg-layout(14)cargo check --target x86_64-pc-windows-msvc -p tuxbox-d3d12Two of the DXBC tests are new:
pixel_programs_can_hold_unordered_access_textures: a pixel program's UAV texture becomes a UAV range at the slot the program reads, under a root visible to all stages or to the pixel stage. The same program read as a mesh program, or under a root for another stage, is refused.pixel_layout_replaces_a_table_the_root_declares_one_slot_short: the root places a constant buffer one slot before the slot the program reads it at, and declares no texture where the program reads one. The replacement table follows the program, and a table the program does not read is left alone.No evidence JSON changed.
@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 16:42 UTC · original · reviewed
Copilot was unable to review this pull request due to rate limiting. Please try again later. See Usage limits for GitHub Copilot for details.