Skip to content

Runtime: deduplicate root_sig CTest and add opt-in Vulkan-Headers fetch - #1044

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
sombraSoft:build/runtime-cmake-hygiene
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
sombraSoft:build/runtime-cmake-hygiene

Conversation

@sombraSoft

@sombraSoft sombraSoft commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: RT-61

What

Two small, self-contained runtime CMake cleanups in runtime/CMakeLists.txt (plus a one-line doc note in runtime/README.md):

  1. Remove duplicate root_sig_test CTest registration: runtime/CMakeLists.txt registered the same root_sig_test executable twice under CTest — once as root_sig_test and once as root_sig. Keep root_sig, matching every other CTest name in the file (loader, pe_loader, device_proxy, xmem, xgameruntime, root_signature, root_signature_oracle, etc.).
  2. Add opt-in -DLEONIDA_VULKAN_HEADERS_FETCH=ON (default OFF): mirrors the existing -DLEONIDA_SDL3_FETCH=ON pattern so contributors without a full LunarG Vulkan SDK can still build the Vulkan test tools (vk_*) and D3D12-over-Vulkan COM targets (gta6rt_d3d12_com, d3d12_*_test) with a single configure flag.
    • Nothing is downloaded unless -DLEONIDA_VULKAN_HEADERS_FETCH=ON (or -DFETCHCONTENT_SOURCE_DIR_VULKANHEADERS=<path> for an offline copy) is passed.
    • Pinned to the same Khronos Vulkan-Headers vulkan-sdk-1.4.363.0 commit (6802bb4733b63ed5efd3adb308a6c885ef180ea1) already used in .github/workflows/runtime.yml, with URL_HASH SHA256=... verification and VULKAN_HEADERS_ENABLE_{TESTS,INSTALL,MODULE}=OFF.
    • Updates the "Vulkan headers not found" configure message and runtime/README.md to mention the flag.

Tracked in #1006 (carried over from #634): #1006 (comment)

Tested

Windows 11 x64, MSVC 19.51 (VS 2026 Build Tools), Ninja, RelWithDebInfo, NVIDIA GeForce RTX 3060 Ti (driver 32.0.16.2124), VULKAN_SDK unset and -DCMAKE_DISABLE_FIND_PACKAGE_Vulkan=ON to force both code paths:

  • Default (LEONIDA_VULKAN_HEADERS_FETCH=OFF):
    cmake -S runtime -B <build> -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_DISABLE_FIND_PACKAGE_Vulkan=ON
    Configures in 1.9 s with zero downloads and prints the updated status message mentioning -DLEONIDA_VULKAN_HEADERS_FETCH=ON.
  • Opt-in (-DLEONIDA_VULKAN_HEADERS_FETCH=ON):
    cmake -S runtime -B <build> -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_DISABLE_FIND_PACKAGE_Vulkan=ON -DLEONIDA_VULKAN_HEADERS_FETCH=ON
    cmake --build <build> --parallel
    ctest --test-dir <build> --output-on-failure
    • Downloads and SHA-256 verifies KhronosGroup/Vulkan-Headers 6802bb47... (vulkan-sdk-1.4.363.0), builds all 172/172 targets including gta6rt, gta6rt_d3d12_com, vk_*, and d3d12_*_test.
    • CTest: 32/32 passed, 0 failed (gameinput disabled without SDL3; root_sig runs once instead of twice).

No game files. AI-assisted.

Checklist

  • No game files, keys, disassembly, shaders, textures, audio, or logs quoting them
  • Nothing online (no Xbox Live / Rockstar services); LEONIDA_VULKAN_HEADERS_FETCH is opt-in (OFF by default) and hash-checked
  • Tested locally without game files

@bobcatchris

Copy link
Copy Markdown
Contributor

Static verification of a97ac608 (no local MSVC build attempted here; the sandbox blocks that toolchain path):

  • root_sig CTest dedup is real and safe. On 43d4703 runtime/CMakeLists.txt registers the same executable twice: add_test(NAME root_sig_test COMMAND root_sig_test) and add_test(NAME root_sig COMMAND root_sig_test) (lines 423 and 430). This PR removes the first and keeps root_sig (line 419 here). A repo-wide search found no CI workflow, script or CTest filter selecting the old CTest name root_sig_test; docs/d3d12_vulkan.md and scripts/build_runtime.ps1 refer to the executable, not the test name. The other similarly named tests (root_signature, root_signature_oracle) are untouched.
  • The Vulkan-Headers pin checks out. The URL commit 6802bb4733b63ed5efd3adb308a6c885ef180ea1 matches the workflow's cache key and checkout ref in .github/workflows/runtime.yml (lines 56 and 62). I downloaded that exact tarball and its SHA256 is 9044fbb356160e43201dc2094acb44c8a906722a63a35f48fc0f051579db9bb6, byte-for-byte the URL_HASH in the PR.
  • Upstream CMakeLists.txt at that commit defines add_library(Vulkan::Headers ALIAS Vulkan-Headers) and all three options this PR forces off (VULKAN_HEADERS_ENABLE_TESTS, _INSTALL, _MODULE), so FetchContent_MakeAvailable(VulkanHeaders) provides the target the rest of runtime/CMakeLists.txt expects. The fetch is genuinely opt-in: LEONIDA_VULKAN_HEADERS_FETCH defaults OFF and the branch is reached only when no Vulkan::Headers target or installed header was found.
  • The README change matches the CMake guards at lines 566-578: the Vulkan tools and D3D12-over-Vulkan COM targets sit under if(TARGET Vulkan::Headers), with the COM targets additionally gated on WIN32 AND Python3_FOUND. One small documentation nuance: the new sentence says those COM targets are built when Vulkan headers are found, but Python3 is also required; the surrounding text already assumes Windows. Not a functional problem.

The red windows check is the known stale descriptor-shader filename failure on 43d4703 (fixed by #1029), not caused by this diff; all other listed checks are green. From the static checks, this looks ready.

@quackottu quackottu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested a97ac60 on NVIDIA GeForce RTX 5070, driver 621.24, Windows 11 Pro (26300), VS 2022 Build Tools, Vulkan SDK 1.4.363.0, with LEONIDA_VK_VALIDATION=1 and LEONIDA_D3D12=vulkan: pass

  • ctest -C RelWithDebInfo: 100% tests passed, 0 tests failed out of 32
  • 37 test programs in the build pass with 0 validation errors
  • d3d12_clear_test fails (R8G8B8A8_UNORM/SNORM 0.5 ties and a D16 clear byte differ from WARP) exactly as on main 4a36bb1 here, so not from this PR; #521 addresses it

Implicit Vulkan layers (overlays) were off through an empty VK_IMPLICIT_LAYER_PATH.

@UlteriorMotive00

Copy link
Copy Markdown
Contributor

Tested a97ac60 on Windows: pass.

Windows 11 Home 10.0.26300, MSVC 14.44.35207, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, Ninja RelWithDebInfo (scripts\build_runtime.ps1, default options, so the opt-in Vulkan-Headers fetch is off), LEONIDA_VK_VALIDATION=1, VK_LOADER_LAYERS_DISABLE=~implicit~. Two GPUs on one PC, picked with VK_LOADER_DRIVERS_SELECT: AMD Radeon RDNA2 iGPU (2026.04.17) and RTX 5070 (617.42).

AI-assisted (Claude Code). No game files.

@ItsNotRexed
ItsNotRexed merged commit fa39a57 into ItsNotRexed:main Nov 22, 2026
9 of 10 checks passed
@sombraSoft
sombraSoft deleted the build/runtime-cmake-hygiene branch November 22, 2026 07:27
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.

5 participants