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

Manually merged
github merged 1 commit from gh-pr/1941/head into gh-pr/1941/base 2026-11-26 10:12:10 +00:00
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-25 16:19 UTC · original
abnalstlll-byte:feat/rt-texture-tiles-host-adapter → main · +66 −4 · 1 files · 1 commits · merged 2026-11-25 19:20 UTC

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

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)

**@⁠abnalstlll-byte** on GitHub · 2026-11-25 16:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1941) `abnalstlll-byte:feat/rt-texture-tiles-host-adapter` → `main` · +66 −4 · 1 files · 1 commits · merged 2026-11-25 19:20 UTC Item ID: `RT-TEXTURE-TILES-HOST-ADAPTER` (claimed in Issue #1608: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) 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)
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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:12:06 +00:00
github manually merged commit ae74f89d1e into gh-pr/1941/base 2026-11-26 10:12:10 +00:00
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 19:20 UTC · original

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).

**@⁠aslan2142** on GitHub · 2026-11-25 19:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1941#issuecomment-7172162719) 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).
This discussion has been locked. Commenting is limited to contributors.
No description provided.