d3d12: reuse live page imports outside registered page pools #148
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!148
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/148/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?
@JeffreyBytes on GitHub · 2026-11-25 06:00 UTC · original
JeffreyBytes:fix/page-import-reuse→main· +117 −24 · 2 files · 2 commits · merged 2026-11-25 07:30 UTCSummary
Fixes #147.
A placed resource imports the guest pages it covers as a host heap. Live imports were only shared for single pages inside a registered Xbox GPU page pool. ProjectScarlett places nearly all of its resources outside the pool, so the same pages were imported over and over. Each import is another driver buffer. On RADV every live buffer goes with each submission, which kept the
vkd3d_queuethread pinned in the submit ioctl while the GPU sat idle.Two commits, both in the weak import cache next to the pool caches in
PagePools:Both use the same exact-range reuse and
ImportedHeap::is_livecheck asheap_page_cache.rs. The cache never owns a heap, and a range is reopened once its import is released or its pages are remapped.TUXBOX_TRACE_BUFFER_BACKINGreports the new paths aspage_open/page_hitandspan_open/span_hit.A/B on an RX 6700 XT (RADV, Mesa 26.3.1), same warm cache and settings, only
d3d12_xs.dlldiffering. Each run was sampled when the game process was 300 s old:mainThis doesn't fix the black screen, but the submit thread is no longer the limit. An earlier version of this description attributed the remaining buffers to the title's 450 always-live command allocators. Counting live imports by size showed most of them were the multi-page case above. The allocators account for about 2,100 of the 4,094 that remain; pooling them removed those buffers in a prototype without improving the frame rate, so that is not part of this PR.
The change doesn't depend on #146. It was measured with #146 underneath only because this machine's Intel CPU needs it to get past startup.
Checks
All of the CONTRIBUTING.md checks pass on this branch: the Python unit tests, the shader compiler, DXBC and XG layout tests, and the Windows typecheck of
tuxbox-d3d12with no warnings. Thetuxbox-d3d12unit tests also pass under Proton's Wine (80/80), including three newheap_page_cachetests for the multi-page key. No evidence JSON changed.@JeffreyBytes on GitHub · 2026-11-25 07:25 UTC · original · edited 2026-11-25 07:28 UTC
The follow-up is pushed: this PR now has a second commit that shares multi-page imports too, and the description above is updated with the corrected diagnosis and the 300 s A/B numbers (it previously attributed the remaining buffers to command allocators). If you would rather take the second commit as a separate PR, say so and I will split it out.