Skip to content

d3d12_fence_timing: compare GetCustomHeapProperties on the layer's adapter - #6948

Open
IxMxAMAR wants to merge 15 commits into
ItsNotRexed:mainfrom
IxMxAMAR:fence-timing-layer-adapter
Open

IxMxAMAR wants to merge 15 commits into
ItsNotRexed:mainfrom
IxMxAMAR:fence-timing-layer-adapter

Conversation

@IxMxAMAR

@IxMxAMAR IxMxAMAR commented Nov 23, 2026 •

Copy link
Copy Markdown

Claimed in the coordination issue as: D3D-667 (#6750 (comment))

Depends on: #4577 (this branch is its head 2ae764b plus one commit, 760442f, which is the whole change here). Overlaps #6569 and #4756 in the same function.

What and why

check_custom_heap_properties created its host device with D3D12CreateDevice(nullptr, ...), D3D12's default adapter. On a PC whose first adapter is an integrated GPU, that is not the GPU the layer runs on. Here (Intel iGPU first, layer on an RX 9070 XT) the check printed "the host adapter is UMA; not compared" and passed without comparing anything. The host now comes from hostadapter::reference, as #4577's fence comparisons get theirs, and the result line names it.

Tested

Windows 11 Pro 26200, AMD Radeon RX 9070 XT (AMD 26.11.2) plus an Intel Graphics iGPU (driver 101.8860) that is DXGI adapter 0, MSVC 19.50 RelWithDebInfo, default device selection:

  • Before: exit 0, "GetCustomHeapProperties: the host adapter is UMA; not compared".
  • After: exit 0, "... and node mask 2 match the host runtime on AMD Radeon RX 9070 XT".
  • With a planted layer bug that is not committed (MEMORY_POOL_L1 for node mask 2): exit 0 before, exit 1 after, with "node mask 2, heap type 2: ours 0/0/2/1/1, host 0/0/0/1/1".
  • With LEONIDA_HOST_ADAPTER=intel, and with the layer on the iGPU: "the host adapter is UMA; not compared", as before.
  • ctest without the window tests: 237 tests, the same 4 failures as on main 561b65a (vk_queue_query_sync, d3d12_texture_tiles, d3d12_indirect_dispatch_count, d3d12_heap_properties, each with an open fix or claim); d3d12_fence_timing passes.

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a, no translator rule)

gabrielsteglich and others added 15 commits November 22, 2026 21:02
Defer reserved-buffer tile updates and copies alongside held command batches and signals. Keep sparse backing alive, resolve source mappings at submission order, and carry waits past no-op or rejected binds.

Compare all tile readbacks with native D3D12 for CPU and COPY queue signals, and test wait forwarding with a fake incomplete Vulkan producer.
…'s adapter

The host device came from D3D12CreateDevice(nullptr), D3D12's default
adapter, which on a PC whose first adapter is an integrated GPU is not
the GPU the layer runs on. With an Intel iGPU first and the layer on an
RX 9070 XT the check printed "the host adapter is UMA; not compared" and
passed without comparing. Take the host from hostadapter::reference, as
the fence comparisons do, and name it in the result line.
@thehollowedone

Copy link
Copy Markdown

Independent native Windows check of 760442fe on the published #4577 stack. RTX 3080 Ti, NVIDIA 621.35, MSVC 19.44, Vulkan SDK 1.4.363.0.

With no host-adapter override, the native D3D12 device and Vulkan-backed proxy selected the same RTX 3080 Ti and returned the same adapter identifier (LUID). For DEFAULT, UPLOAD, and READBACK with node mask 0, all five heap-property fields matched native D3D12. The layer also passed all six expected-value checks across node masks 0 and 1. The focused d3d12_fence_timing fixture ran the heap-property queries with zero skips and zero Khronos core or synchronization validation errors.

AI-assisted.

@devnull34 devnull34 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on AMD Radeon RX 7900 GRE (Windows 11):

  • Built d3d12_fence_timing_test cleanly with MSVC.
  • d3d12_fence_timing_test.exe passed:
    • GetCustomHeapProperties: DEFAULT, UPLOAD, READBACK, CUSTOM, unknown type, and node mask 2 correctly matched the host runtime on AMD Radeon RX 7900 GRE rather than falling back to default/UMA bypass.
    • Multi-fence waits, CPU/queue rewinds, and clock calibration all verified.
  • CTest target 162: d3d12_fence_timing passed 100% (2.02s).
  • Whitespace clean (git diff HEAD~1..HEAD --check).

@ErayOzdayioglu

Copy link
Copy Markdown

Tested 760442f on the mirror image of the PR's machine: here the discrete GPU is DXGI adapter 0 (NVIDIA GeForce RTX 5070, 617.42) and the iGPU is second (AMD Radeon Graphics, the Ryzen 5 7600's RDNA2 iGPU, 32.0.21042.62). Windows 11 26200, MSVC 14.51 (VS 2026), RelWithDebInfo, d3d12_fence_timing_test run directly: pass, and the change does what it says in this topology too.

layer on before (2ae764b, #4577's head) after (760442f)
RTX 5070 (LEONIDA_VK_DEVICE=5070, also the default) exit 0: "... node mask 2 match the host runtime" exit 0: "... node mask 2 match the host runtime on NVIDIA GeForce RTX 5070"
Radeon iGPU (LEONIDA_VK_DEVICE=radeon) exit 0: "... match the host runtime", where the host is the default adapter, i.e. the RTX 5070, not the GPU the layer runs on exit 0: "GetCustomHeapProperties: the host adapter is UMA; not compared"

So with the layer on the iGPU, the old code compared the layer's answers against the other GPU and reported a match. The new code picks the same adapter, as the GetAdapterLuid line confirms (00000000:0001329e is the DXGI adapter "AMD Radeon(TM) Graphics"), and then skips the comparison as UMA. Everything else in the test passes on both GPUs: the fence, rewind, cross-queue and calibration lines, and the WARP and standalone Vulkan sections.

A side observation, not a problem with this PR: since the old run "matched" a discrete host with the layer on a UMA iGPU, the layer's GetCustomHeapProperties answers look discrete-shaped on an iGPU. I haven't compared them with the iGPU's own D3D12 values (the test skips UMA by design).

AI-assisted: yes

@nnonno91

Copy link
Copy Markdown

AI-assisted verification of 760442f on the published #4577 stack. Windows 11 (build 26200), RTX 5090 (NVIDIA 617.42, Vulkan 1.4.351, subgroup 32..32), MSVC 19.51.36244 Release, with AMD Radeon integrated graphics available too.

I ran d3d12_fence_timing_test twice with automatic D3D12 host-adapter selection, choosing each Vulkan device in turn. Both runs exited 0.

  • RTX 5090: GetAdapterLuid identified the NVIDIA DXGI adapter. DEFAULT, UPLOAD, READBACK, CUSTOM, the unknown heap type, and node mask 2 all matched the native D3D12 runtime on the RTX 5090.
  • AMD Radeon integrated graphics: GetAdapterLuid identified the AMD DXGI adapter, and the heap comparison took its expected UMA skip.

Synthetic tests only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants