mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-28 12:01:11 +00:00
CreateHeap returns the backing heap only for an explicit request. The config block must set BX_D3D12_VMEM_FLAG_BACKING_HEAP and the desc must be CUSTOM, WRITE_BACK, L0, flags NONE, at the configured size. Every other CreateHeap and CreatePlacedResource is forwarded unchanged to the host. Only the live-heap budget wrapper remains, and it answers ID3D12Heap1 when the host heap does. D3D12ConfigureVirtualMemoryX reads an 8-byte BXVM magic and size header before anything else, copies the block, and never keeps the caller's pointer. cpu_pointer is written only during the call. A second call with the same region returns the map address once the backing heap exists. test_d3d12_placed covers same-size UPLOAD and DEFAULT plus DENY_BUFFERS heaps, a 100000-byte UPLOAD heap, 4 KiB small-resource placement, ID3D12Heap1, and a config block that is gone before CreateHeap. Signed-off-by: devil8blade <360741796+devil8blade@users.noreply.github.com>