Skip to content

test: respect LEONIDA_HOST_ADAPTER and layer LUID in d3d12_texture_tiles (RT-TEXTURE-TILES-HOST-ADAPTER) - #1941

Merged
aslan2142 merged 1 commit into
ProjectLeonida:mainfrom
abnalstlll-byte:feat/rt-texture-tiles-host-adapter
Nov 25, 2026
Merged

aslan2142 merged 1 commit into
ProjectLeonida:mainfrom
abnalstlll-byte:feat/rt-texture-tiles-host-adapter

Conversation

@abnalstlll-byte

Copy link
Copy Markdown
Contributor

Item ID: RT-TEXTURE-TILES-HOST-ADAPTER (claimed in Issue #1608: #1608 (comment))

Addresses Finding #623 by @efeekrb (Issue #1608):
runtime/test/d3d12_texture_tiles_test.cpp:251 previously used an unguided native_device() adapter enumeration loop that completely ignored LEONIDA_HOST_ADAPTER and the layer's Vulkan device LUID. On dual-GPU systems (such as laptops with integrated Intel UHD and discrete NVIDIA RTX), the native D3D12 reference device defaulted to the iGPU and failed on Intel CopyTiles offset rounding quirks even when LEONIDA_HOST_ADAPTER was explicitly pointed to the NVIDIA GPU.

Changes

  1. Added <cctype> and <string> includes in runtime/test/d3d12_texture_tiles_test.cpp.
  2. Implemented tiled_device(IDXGIFactory4&, LUID, bool) and native_device(LUID layer_luid) matching the verified pattern in runtime/test/d3d12_buffer_tiles_test.cpp.
  3. Read LEONIDA_HOST_ADAPTER (case-insensitive substring match or "warp"). When unset, default to the adapter matching the layer Vulkan device LUID (vulkan->GetAdapterLuid()).
  4. If the selected adapter lacks Tier 2 tiled resources, cleanly skip the native reference comparison instead of falling back to the wrong hardware.
  5. In main(), ensure that when LEONIDA_HOST_ADAPTER is unset and the layer's adapter supports Tier 2 tiled resources, the native reference device runs on the exact same adapter.

Verification

  • Clean-room: zero retail binaries, game assets, or carved shaders.
  • Verified standalone syntax conformance under g++ -std=c++20 -fsyntax-only.
  • Verified python -I scripts/check_no_game_data.py runtime/test/d3d12_texture_tiles_test.cpp.
  • Verified python -I tests/test_text_write_line_endings.py.

AI-assisted (Claude Code)

…les (RT-TEXTURE-TILES-HOST-ADAPTER)

runtime/test/d3d12_texture_tiles_test.cpp previously used an unguided native_device() adapter loop that ignored LEONIDA_HOST_ADAPTER and the layer's Vulkan device LUID, defaulting to an integrated GPU (e.g. Intel UHD) on dual-GPU laptops even when configured for discrete GPU testing.

Pass vulkan->GetAdapterLuid() to native_device() and query LEONIDA_HOST_ADAPTER matching the pattern in d3d12_buffer_tiles_test.cpp, skipping the native reference comparison cleanly when the requested adapter lacks tier 2 tiled resources instead of failing on the wrong hardware.

AI-assisted (Claude Code)
@aslan2142
aslan2142 merged commit 205bda4 into ProjectLeonida:main Nov 25, 2026
2 of 5 checks passed
@aslan2142

Copy link
Copy Markdown
Collaborator

Merged, thanks! It mirrors d3d12_buffer_tiles_test.cpp. Under Wine, d3d12_texture_tiles passes on a RADV iGPU and skips on llvmpipe, the same as on main; no test went from pass to fail.

  • Checked on main 6a2e9ea93 + ae74f89d1: it merges cleanly; the semantic suite passes (491 files, 6,312 tests, 0 files failed); the 15 docs and writer tests pass; check_no_game_data.py is clean on the 1 changed files.

AI-assisted (Claude Code, Claude Opus 5.5).

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.

2 participants