M2(Vulkan): Vulkan mock-game backend + volk/Vulkan-Headers submodules

Add render_vk.cpp (selectable as `vk`): brings up a real Vulkan
instance/device/swap chain via volk (which dlopens vulkan-1.dll -- the
loader-bypass case the capture hook must handle) and clears the swap-chain image
to the frame-counter colour each frame with vkCmdClearColorImage (no pipeline,
no shaders, no SPIR-V) and presents. The whole image encodes the frame number,
so it animates and stale frames are detectable.

Adds the official Khronos Vulkan-Headers + zeux/volk submodules and a
coop_require_submodule() CMake helper that fails with a clear "git submodule
update --init --recursive" message rather than auto-cloning. volk is pinned to
the project's dynamic CRT (no LNK4098).

mock_game_test gets a vk liveness check (its present pointer is cached at init,
so late injection can't hook it -- the capture path needs the early-load path,
to come). 16/16 ctest, skips cleanly without a Vulkan driver.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 12:12:55 +02:00
parent e996188aec
commit 49daa1d81f
11 changed files with 406 additions and 3 deletions

View File

@@ -35,6 +35,19 @@ function(coop_output_subdir subdir)
endforeach()
endfunction()
# Fail with a clear message if a git submodule wasn't checked out, instead of a confusing
# "file not found" deep in a build. `sentinel` is a path (relative to the source root) that
# only exists when the submodule is populated. We deliberately do NOT auto-clone -- explicit
# is better than a surprise network fetch during configure.
# Usage: coop_require_submodule(<name> <sentinel-path>).
function(coop_require_submodule name sentinel)
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/${sentinel}")
message(FATAL_ERROR
"Submodule '${name}' is not checked out (missing ${sentinel}).\n"
"Run: git submodule update --init --recursive")
endif()
endfunction()
if(MSVC)
add_compile_options(/W4 /permissive- /Zc:__cplusplus /utf-8 /MP)
add_compile_definitions(UNICODE _UNICODE WIN32_LEAN_AND_MEAN NOMINMAX)