D3D12.X: video-memory arenas never overlap #121
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/122"
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 ivall/xcl. Originally posted by gefydev on 2026-11-23T13:25:18Z.
#104 item 1.
arena_forreused an arena only if it held the whole placement. A new arena took the 32 MiB blocks from below the address up to 128 MiB, with no check against the arenas already there. So a placement that straddled an arena, or a new arena that grew into one, gave two heaps over the same title addresses. Resources at one address could then land in different heaps and stop aliasing.The layout is now a pure function,
plan, over the arena ranges.arena_forapplies it:I picked merging over "allocate the remainder" because a D3D12 resource must sit in one heap. A straddling resource cannot be split between the old arena and a remainder heap.
Tests in
vram::tests, CPU only:Each step also checks that no two arenas overlap. With the old rule the first test's second step gives
[0x1_0200_0000, +128 MiB)over the first arena. The other lib tests pass on a GTX 1650 under Wine. Not run with a retail title.Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T14:14:10Z.
Merged. XDefiant hits it in practice: ~78 s in it logs one straddling placement merged into a new arena, and runs on. Checked on Windows 11 with an RX 9070 (RDNA4), merged together with the rest of #110–#129:
cargo test --workspacegreen with the retail samples (shader pack, console DLLs, texture archive), lib tests also withXCL_SPLIT_WAVE64=1; the retail pack still translates 26 698 / 26 698; the FSR4 GPU probe passes; Unicorn Overlord and XDefiant run. Thanks!