Skip to content

tests: honor LEONIDA_HOST_ADAPTER in fsr_dispatch_test and skip null PC D3D12 devices - #8160

Open
Sakura-Byte wants to merge 1 commit into
ItsNotRexed:mainfrom
Sakura-Byte:fix/fsr-bvh-adapter-and-null-skip
Open

Sakura-Byte wants to merge 1 commit into
ItsNotRexed:mainfrom
Sakura-Byte:fix/fsr-bvh-adapter-and-null-skip

Conversation

@Sakura-Byte

Copy link
Copy Markdown

Claimed in the coordination issue as: #7804 (comment) (following @XFlawless1's finding and @XmYx's finding)

Depends on: none (note: touches runtime/test/fsr_dispatch_test.cpp and runtime/test/bvh_builder_test.cpp, which #5812 also edits for a separate Windows 10 resource refusal check)

What and why

  • runtime/test/host_adapter.h: guards vk_test_device.h and hostadapter::reference(...) with LEONIDA_HOST_ADAPTER_HAS_VULKAN (!defined(LEONIDA_HOST_ADAPTER_DXGI_ONLY) && (defined(VK_VERSION_1_0) || __has_include(<vulkan/vulkan.h>))) so non-Vulkan / DXGI-only test targets keep compiling when reusing hostadapter::wanted(), hostadapter::named(), and hostadapter::description().
  • runtime/test/fsr_dispatch_test.cpp: replaces create_pc_device() with select_pc_device() + handle_missing_pc_device() to honor LEONIDA_HOST_ADAPTER (case-insensitive substring or "warp", failing with exit 1 on mismatch; LEONIDA_FSR_WARP=1 takes precedence) and print SKIP (naming LEONIDA_FSR_DEVICE=vulkan) + exit 77 (SKIP_RETURN_CODE) when no PC D3D12 device exists (unless prior checks failed); adds --self-test, --self-test-null-skip, and --self-test-bad-adapter.
  • runtime/test/bvh_builder_test.cpp: adds select_pc_device() + handle_missing_pc_device() so a missing PC D3D12 device prints SKIP (naming LEONIDA_BVH_DEVICE=vulkan) and exits 77 while preserving prior failures as 1; adds --self-test and --self-test-null-skip.
  • runtime/CMakeLists.txt: registers fsr_dispatch_selftest and bvh_builder_selftest CTest targets.

Tested

Windows 11, MSVC 2022 (19.44.35228.0), Windows SDK 10.0.26100.0, Vulkan SDK 1.4.363.0, NVIDIA GeForce RTX 5090 D / driver 621.14.

  • Compliance: python -I scripts/check_no_game_data.py on all 4 changed files -> exit 0; git diff --check -> clean; 0 CRLF bytes across all 4 files; git merge-tree --write-tree upstream/main HEAD -> clean (0 conflicts).
  • Builds & CTest:
    • Full Vulkan build (RelWithDebInfo, -DLEONIDA_REQUIRE_VULKAN=ON): 654 targets built, 0 warnings.
    • Non-Vulkan build (-DLEONIDA_REQUIRE_VULKAN=OFF -DCMAKE_DISABLE_FIND_PACKAGE_Vulkan=ON, Vulkan headers hidden): 19/19 targets compiled cleanly; fsr_dispatch_test --self-test and bvh_builder_test --self-test passed (0 failures).
    • ctest 5-test target subset (host_adapter|fsr_dispatch|fsr_dispatch_selftest|bvh_builder|bvh_builder_selftest): 3/5 passed, 2/5 skipped (fsr_dispatch, bvh_builder without LEONIDA_GAME_DIR), 0 failed; expanded 13-test host_adapter/FSR/BVH consumer subset: 11/13 passed, 2 skipped, 0 failed.
    • CLI self-tests: --self-test passed (0 failures) on both; --self-test-null-skip exited 77 on both; --self-test-bad-adapter exited 1 on fsr_dispatch_test.
  • Live package checks (LEONIDA_GAME_DIR pointed to own Xbox Series 1.0.2.1 package; outcomes only, no package bytes or logs):
    • fsr_dispatch_test: default (RTX 5090 D) -> OK (0); LEONIDA_HOST_ADAPTER=warp (WARP) -> OK (0); LEONIDA_HOST_ADAPTER=radeon (AMD Radeon iGPU) -> OK (0); LEONIDA_HOST_ADAPTER=nonexistent_adapter -> FAIL (1); LEONIDA_FSR_DEVICE=vulkan -> OK (0).
    • bvh_builder_test: default (WARP) -> OK (0); LEONIDA_BVH_DEVICE=vulkan -> OK (0).
  • Negative controls (reverting explicit_host handling and returning 1 on null PC device): fsr_dispatch_selftest failed (7 failures) and bvh_builder_selftest failed (1 failure).

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

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