Skip to content

d3d12_buffer_tiles: compare on the layer's own adapter when LEONIDA_HOST_ADAPTER is unset - #6201

Open
caltr98 wants to merge 1 commit into
ItsNotRexed:mainfrom
caltr98:fix-buffer-tiles-layer-adapter
Open

caltr98 wants to merge 1 commit into
ItsNotRexed:mainfrom
caltr98:fix-buffer-tiles-layer-adapter

Conversation

@caltr98

@caltr98 caltr98 commented Nov 23, 2026

Copy link
Copy Markdown

Item: new, claimed in #6089 (d3d12_buffer_tiles on a two-GPU PC).

What

d3d12_buffer_tiles compared the layer with the first hardware adapter that has tiled resources tier 2. On a laptop with an RTX 5080 and an Intel iGPU, that adapter is the iGPU, and its native D3D12 run reads zeros, so the test failed although the layer was right:

Vulkan replay: 12 full tiles matched across aliased, skipped, unmapped, reused and remapped ranges
native D3D12 snapshot 1 tile 0: word 0 reads 0000000000, want 0x23456789 (16384 of 16384 words wrong)
line 194: wrong_tiles == 0
Native D3D12: Intel(R) Graphics, tiled resources tier 4

With LEONIDA_HOST_ADAPTER unset, native_device() now first tries the adapter behind the layer's device (GetAdapterLuid()), the rule runtime/test/host_adapter.h already sets for the other host comparisons. The old loop stays as the fallback, and a named adapter or warp works as before. The tier check moved into a small tiled_device() helper shared by both paths. Test-only change.

Tested

NVIDIA GeForce RTX 5080 Laptop GPU, driver 621.14, plus Intel(R) Graphics; Windows 11 (build 26300); MSVC 14.44, RelWithDebInfo; d3d12_buffer_tiles_test on this branch rebased on current main:

LEONIDA_HOST_ADAPTER native side result
unset (before, main at 3faac55) Intel(R) Graphics fail, line 194
unset (this PR) NVIDIA RTX 5080 Laptop pass
warp Microsoft Basic Render Driver pass
NVIDIA NVIDIA RTX 5080 Laptop pass
Intel Intel(R) Graphics fail, line 194 (the Intel host driver; not investigated further)

Not tested: a PC where the layer's adapter has no D3D12 device (that takes the fallback loop, unchanged).

AI-assisted (Claude).

🤖 Generated with Claude Code

…OST_ADAPTER is unset

The native half took the first hardware adapter with tiled resources tier 2. On a laptop with an
RTX 5080 (NVIDIA 621.14) and an Intel iGPU that is the iGPU, whose native run reads zeros from all
16384 words of snapshot 1, so the test failed at line 194 although the layer and the NVIDIA host
driver agree. Unset now means the adapter behind the layer's device (GetAdapterLuid), as
host_adapter.h already rules for the other host comparisons; the old loop remains the fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant