d3d12: import non-contiguous XMem backings through a reserved buffer #253
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/253"
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 DrArroway on 2026-11-26T17:20:42Z.
Summary
Extends #218 for #191 to support non-contiguous XMem physical backings using
CreateReservedResource+ synchronousUpdateTileMappings, for the multi-view GPU-alias imports where page orders disagree across imports (@gtb-sbe measured 16 of 131 imports / 277.6 MiB requiring this path in ProjectScarlett).Changes
TuxBoxAcquirePhysicalBacking+TuxBoxReleasePhysicalBackingcontract unchanged and adds an optional fallback toTuxBoxAcquirePhysicalBackingRuns: WhenTuxBoxAcquirePhysicalBackingfails withERROR_NOT_SUPPORTEDandTuxBoxAcquirePhysicalBackingRunsis exported, tries a 16-entry inline stack buffer (retrying onERROR_MORE_DATA/ERROR_INSUFFICIENT_BUFFER), validates 64 KiB alignment and summed byte size while always releasing the hold on error, collapses single-run responses to contiguous, and otherwise returnsAcquiredBacking::Scattered.wait_for_queue/with_init_transition) onInitTransitionand added synchronousmap_reserved_tiles(UpdateTileMappings).extra_heaps+ImportedHeap::scatteredpreserving drop order (native->extra_heaps->_pin->_shadow->_backing).import_scattered_buffer(requiresoffset == 0,ID3D12Device13,TiledResourcesTier >= 1, opens each piece viaOpenExistingHeapFromAddress1, creates a buffer viaCreateReservedResource, maps all piece heaps viamap_reserved_tiles, attaches all heaps to the resource).acquire_backingintoimport_buffer_with_heapand guardsreusable_for/buffer_aliason scattered heaps.> 16runs), hold release on invalid runs, and single-run collapse, plus a real-GPU test (scattered_alias_imports_through_reserved_buffer_and_aliases_cpu_and_gpu) verifying[c, a, b]and[b, c]scattered aliasing, non-64 KiB multiple width (2 * PAGE + 1024),ALLOW_UNORDERED_ACCESS, bidirectional CPU/GPU reads/writes, hold release, and post-drop submit survival.Like #218, this stays dormant until
xmem.dllexportsTuxBoxAcquirePhysicalBackingRuns(andTuxBoxAcquirePhysicalBacking).tuxbox-d3d12teststuxbox-d3d12on RX 6900 XT (GE-Proton11-14):163 passed, 0 failed(11/11device::heap::backing::tests).tuxbox-d3d12under offline Wine:163 passed, 0 failed.Verified on Lanes
A pull request is not merged until Lanes passes on a GPU. Run:
python tuxbox.py checkpassed on this branchDormant until
xmem.dllexportsTuxBoxAcquirePhysicalBackingRuns; covered on real GPU hardware bydevice::heap::backing::tests::scattered_alias_imports_through_reserved_buffer_and_aliases_cpu_and_gpuusingFakeXmem, while all existing Lanes/fixtures (70/70) and D3D12 regression controls (19/19) pass.GPU, driver and backend: AMD Radeon RX 6900 XT (
1002:73bf), Mesa RADV26.3.1,GE-Proton11-14(vkd3d-proton), Windows DXCv1.9.2609.Paste the summary printed at the end: