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

Merged
leonida/mandy
abnalstlll-byte merged 1 commit from feat/rt-texture-tiles-host-adapter into main 2026-11-25 19:20:31 +00:00

Pull request successfully merged and closed

abnalstlll-byte commented 2026-11-25 16:19:56 +00:00

Item ID: RT-TEXTURE-TILES-HOST-ADAPTER (claimed in Issue #1608: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7167704003)

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)

Item ID: `RT-TEXTURE-TILES-HOST-ADAPTER` (claimed in Issue #1608: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7167704003) 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)
aslan2142 commented 2026-11-25 19:20:34 +00:00

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

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 in to join this conversation.
No description provided.