d3d12: page bindless compute roots through the resource index map #235

Open
github-bot wants to merge 1 commit from github-bot/gh-235 into main AGit
Owner

@⁠ReverendOzmund on GitHub · 2026-11-26 14:50 UTC · original
ReverendOzmund:d3d12-bindless-compute-roots → main · +71 −1 · 3 files · 1 commits · open

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_root only 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 to Unsupported, got no reflected layout, and the paged path refused it.

  • reflected_root now 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.
  • The translator already reads tb_heap_map when the root carries that SRV (heap_map in setup.rs), so these programs translate as tb_heap_index(i), a guest-to-host lookup, instead of using the guest index directly.
  • with_reflected_table now 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_heap covers the root shapes this accepts and the ones it leaves to the existing paths. cargo check --target x86_64-pc-windows-msvc --tests is clean, and build.py d3d12 builds.

Verified on Lanes

  • python tuxbox.py check passed on this branch: not yet
  • Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below

Draft. 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

**@⁠ReverendOzmund** on GitHub · 2026-11-26 14:50 UTC · [original](https://github.com/brcly/TuxBox/pull/235) `ReverendOzmund:d3d12-bindless-compute-roots` → `main` · +71 −1 · 3 files · 1 commits · open 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_root` only 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 to `Unsupported`, got no reflected layout, and the paged path refused it. - `reflected_root` now 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. - The translator already reads `tb_heap_map` when the root carries that SRV (`heap_map` in `setup.rs`), so these programs translate as `tb_heap_index(i)`, a guest-to-host lookup, instead of using the guest index directly. - `with_reflected_table` now 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_heap` covers the root shapes this accepts and the ones it leaves to the existing paths. `cargo check --target x86_64-pc-windows-msvc --tests` is clean, and `build.py d3d12` builds. ## Verified on Lanes - [ ] `python tuxbox.py check` passed on this branch: not yet - [ ] Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below Draft. 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.com/claude-code) https://claude.ai/code/session_01KP1nQKEc17PvmrwfPtLi8Z
A compute root with CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED and no descriptor tables got no reflected layout, so with descriptor paging every dispatch was skipped. Reflect it with the guest's parameters plus the index map root SRV, which the translator already reads, and bind the map for compute as for raster.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Claude-Session: https://claude.ai/code/session_01KP1nQKEc17PvmrwfPtLi8Z
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:56:59 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/235/head:github-bot/gh-235'
git switch 'github-bot/gh-235'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-235'
git switch 'github-bot/gh-235'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-235'
git switch 'github-bot/gh-235'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-235'
git switch 'main'
git merge --squash 'github-bot/gh-235'
git switch 'main'
git merge --ff-only 'github-bot/gh-235'
git switch 'main'
git merge 'github-bot/gh-235'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.