[PR #1941] [MERGED] test: respect LEONIDA_HOST_ADAPTER and layer LUID in d3d12_texture_tiles (RT-TEXTURE-TILES-HOST-ADAPTER) #1946

Closed
opened 2026-11-26 21:19:30 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1941
Author: @abnalstlll-byte
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: feat/rt-texture-tiles-host-adapter


📝 Commits (1)

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

📊 Changes

1 file changed (+66 additions, -4 deletions)

View changed files

📝 runtime/test/d3d12_texture_tiles_test.cpp (+66 -4)

📄 Description

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)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1941 **Author:** [@abnalstlll-byte](https://github.com/abnalstlll-byte) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `feat/rt-texture-tiles-host-adapter` --- ### 📝 Commits (1) - [`ae74f89`](https://github.com/ubiquitarianism/leonida/commit/ae74f89d1e149a7b7a3b24c1e64a705839755311) test: respect LEONIDA_HOST_ADAPTER and layer LUID in d3d12_texture_tiles (RT-TEXTURE-TILES-HOST-ADAPTER) ### 📊 Changes **1 file changed** (+66 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/d3d12_texture_tiles_test.cpp` (+66 -4) </details> ### 📄 Description 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:19:30 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1946
No description provided.