d3d12: page bindless compute roots through the resource index map #235
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/235"
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 ReverendOzmund on 2026-11-26T14:50:56Z.
Fixes the skips reported in #232. With descriptor paging active, every dispatch of a compute pipeline whose root is CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED with no descriptor tables (only root constants and root descriptors) was dropped as
pipeline has no paged descriptor layout: its root indexes the resource heap directly. On ProjectScarlett those come from guest callers 0x248cbc1, 0x248cd0f, 0x2951ba and 0x56bba. On NickStallman's RTX 5090, 0x248cbc1 and 0x2951ba account for most of the ~1,000 skips per world frame.Summary
reflected_rootonly described compute roots with one or two leading tables, or tables followed by constants and descriptors. A table-less bindless root matched neither, so it fell through toUnsupported, got no reflected layout, and the paged path refused it.reflected_rootnow gives a table-less, heap-indexed compute root a reflected layout: the guest's own parameters unchanged, plus the resource index map as a root SRV at t0, space32766. It's visible to all stages, where the raster form uses pixel only.tb_heap_mapwhen the root carries that SRV (heap_mapinsetup.rs), so these programs translate astb_heap_index(i), a guest-to-host lookup, instead of using the guest index directly.with_reflected_tablenow binds the index map for compute, as it already does for raster. Without an arena it binds the identity map, so behaviour without paging is unchanged.bindless_compute_roots_have_no_tables_and_index_the_heapcovers the root shapes this accepts and the ones it leaves to the existing paths.cargo check --target x86_64-pc-windows-msvc --testsis clean, andbuild.py d3d12builds.Verified on Lanes
python tuxbox.py checkpassed on this branch: not yetDraft. No Lanes scenario binds a table-less, heap-indexed compute root with paging active yet. I'll add one, but the in-game effect is the real test. NickStallman offered to run it on the 5090 past the story intro, and I'll run it on a 3080 Ti. The number to watch is the skip count from #223's reason text, which should drop to zero for these callers.
GPU, driver and backend: RTX 3080 Ti, 620.70.06, GE-Proton11-14 (build only so far).
🤖 Generated with Claude Code
https://claude.ai/code/session_01KP1nQKEc17PvmrwfPtLi8Z
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-26T15:54:12Z.
NVIDIA in-game run with this PR: RTX 5090, driver 595.99.02, GE-Proton11-14. The build was
main3b8a220plusd49808d, plus an env-gated experiment of mine that stayed inactive (it logged nothing).ProjectScarlett reached
Game Running, with SRLfbk_stry000_FBK_STRY000_INTRO, at frame 2,648 after about 19 minutes.skipped compute dispatch: pipeline has no paged descriptor layout. The only skips were 2 draws,its root …at guest caller0xbff06, which this PR doesn't cover.0x2951ba(11),0x248cd0f(3),0x248cdf5(3),0x248cbc1(1) and0x56bba(1). The counters reached #512.So on NVIDIA the bindless compute skips are gone. I can't speak to picture correctness yet. The run ended at the intro with a GPU hang,
NVRM: Xid 109 … CTX SWITCH TIMEOUT, and the title's watchdog fired 27 s later. That matches #232 and my earlier #216 runs, which hung without this PR, so I don't think this PR causes it.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-26T16:34:45Z.
Correction to my comment above. Please disregard it. The run didn't include this PR. The provider DLLs in my game folder were still the ones I'd deployed from #216's head earlier, and
tuxbox.py runfrom another worktree doesn't redeploy them. So "0 compute skips" says nothing about this PR; it was the same runtime as my earlier #216 runs, ending at an earlier point. Sorry for the noise. I'll rerun with this PR's DLLs actually deployed and report back.Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-26T17:11:03Z.
Thanks, the approach looks right. Reading it merged onto current
main(with #241), two things before it can merge. Neither is reproduced; both are from the code.create_pipeline_x_inner, the reflected arm falls back toshader_cache::preparedwhen the rooted translation is refused. For a bindless root that translation has notb_heap_map, so with paging active it would index the heap with guest indices, where today the dispatch is skipped. Could this case require the rooted translation?reflected_rootleavesrecovered_samplersempty, so a program with a literal sampler the root lacks no longer reachessampler_root(#241). Settingrecovered_samplerswithliteral_samplers(shader, 5, &signature)there, as the other compute arm does, should cover it.It also still needs the full check on AMD and NVIDIA, a Lanes scenario, and the in-game rerun.
Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-26T17:46:06Z.
AMD full
tuxbox.py checkrun on PR#235(d49808dcleanly merged ontomain5c5677b):1002:73bf), Mesa RADV26.3.1,GE-Proton11-14, Windows DXCv1.9.2609, Linux DXC1.9.260972/72pass19/19pass40/40passImported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T22:20:39Z.
Independent follow-up to the maintainer's review, without changing your PR:
github.com/Valdi320/TuxBox@2f7e0f8afc. Mergedd49808dontoe76ff6a, prevented prepared/rootless fallback when the reflected compute root has an index map, recovered literal samplers in the bindless arm, and allowed valid zero-parameter roots without constructing a slice from null. Added a Lanes synthetic native RDNA2 shader that writes a raw UAV at logical slot 80. The constrained heap limit is 64; the roomy run also uses an arena (Scarlett device11_queue), so neither is claimed as identity/native-heap coverage. Both RTX 4080 / GE-Proton11-14 runs passed, 1,024 words each including decoys and guards, fresh rooted xshader receipt matches the loaded digest, paged map bound, no stand-ins. Run: python tuxbox.py verify --only lanes-bindless-compute. Rebuilt providers and guest. This is a proposed review patch and focused GPU result, not a full check, literal-sampler-specific GPU proof or retail replay. Feel free to cherry-pick the follow-up commit.