Repository navigation
Conversation
…on-zero GetGPUVirtualAddress
|
Independent Windows check of 43510c6a. RTX 3080 Ti, NVIDIA 621.35, MSVC 19.44, Vulkan SDK 1.4.363.0. The stock AI-assisted. |
… synthetic, aligned VA below 2^47 Without the arena the raw Vulkan device address was returned. It can be above 48 bits (a V# keeps 48, so a UAV clear decoded an address below the resource base and Close failed with E_INVALIDARG) and is aligned only as the driver likes (not the 64 KiB promised). Every buffer now takes a synthetic address. The allocator moves to src/synthetic_va.h and only advances its counter on success, so a refused 65,537-byte request no longer makes the next 64 KiB request fail. d3d12_gpuva_test now also runs a device whose arena is refused while the driver answers raw addresses above 48 bits, and records a UAV clear and a WriteBufferImmediate at address + 4 on each device. synthetic_va_test covers the allocator without a GPU.
|
Thanks, all four were right. Fixed in 3ef855a (new commit, no force):
Tested on the RTX 4090 pod under Wine: d3d12_gpuva_test exit 0 after the fix; with the old shim the same test fails (alignment, then 48 bits, then Close E_INVALIDARG). synthetic_va_test passes. AI-assisted. |
|
Tested
AI-assisted (Claude Code). |
|
Context for the RTX 4090 failure reported above ( |
…e own memory is the open D3D-516 gap (ItsNotRexed#5052), as measured on an RTX 4090 with ReBAR
|
@DeSunShine thanks for the run and the diagnosis. You're right that it's the arena's own upload-buffer gap (D3D-516 / #5052), not this change. In d9e614a, the 48-bit check skips only arena-mode UPLOAD/READBACK buffers, with a pointer to D3D-516. DEFAULT buffers in arena mode, and every buffer on the no-arena paths this PR changes, are still checked. Under Wine on an RTX 4090 (p2): exit 0, all three modes run, and the no-arena addresses are 64 KiB aligned from |
Claimed in #6910 (comment)
@ItsNotRexed: an exe PR, as you asked.
What
ID3D12Resource::GetGPUVirtualAddresson a buffer returns a non-zero, 64 KiB-aligned, unique address on a device that has no GPU address arena (nobufferDeviceAddress). Such a buffer used to answer 0. It now answers its raw device address when the driver gives one, else a synthetic address from a never-reused range (DeviceState::synthetic_va_allocate, 2^36 to 2^47). The address is also the buffer'sbinding.va, so the context finds the buffer by it.New test
d3d12_gpuva_test: 1 KiB buffers through the Xbox device proxy in 8 heap/state/flag combinations, on a device with and withoutbufferDeviceAddress. Each must answer non-zero, 256-byte aligned (64 KiB without an arena), and not overlap another live buffer.Why
A title builds root descriptors and V#s from this address, so 0 points the GPU at address 0. It is not state-dependent: the reported COMMON and COPY_DEST cases are two of the eight; on a device without an arena every default, upload and readback buffer answered 0, in every state. With the arena (the device the game gets) all eight were already right, so this changes nothing there. The cause was in
Resource::create_buffer: the non-arena path setva_only when the arena existed, andGetGPUVirtualAddressreturnsva_, never thebuffer_va_it had just fetched.d3d12_descriptor_testbuilds such a device, so this is the setup where it showed up.Open PRs checked (
gh pr list --searchfor "GetGPUVirtualAddress", "buffer device address", "GPU virtual address"), none fixes this: #5456 (docs), #157 and #334 (GFX10 descriptor views), #770 (placed texture aliasing), #4609, #6168 (WriteBufferImmediate Close parity), #3293 (DRED) do not touch the non-arena buffer path.Tested
On pod p2 (RTX 4090, Wine,
/root/fast_test_exe.sh):d3d12_gpuva_testexits 1: the eight arena cases print 0x10000 to 0x60000 (default) and 0x10000000, 0x10010000 (upload, readback), thenno bda: default COMMON -> 0x0,line 90: address != 0.d3d12_descriptor_test,d3d12_vulkan_device_testandd3d12_buffer_uav_testexit 0 after the fix.