Files
CoopAllTheThings/vk_layer/coop_vk_layer.cpp
BlackMark 0e57863d1f Share the Vulkan swapchain tracking between the hook and the layer
vk_hook.cpp and coop_vk_layer.cpp each carried a verbatim copy of the
swap-chain registry -- the SwapInfo struct, the vector+mutex, find_swap,
the create-time de-dup + LRU cap, and the present-time lookup -- because
they are two independent early-presence paths (inline hook vs implicit
layer). The tracking logic is identical, so lift it into one
VkSwapchainRegistry (hook/src/vk_swapchain_registry.hpp); each module
owns an instance. add() de-dups + LRU-caps, lookup() copies the frame
out under the lock, clear() resets -- same behavior, one definition.

Net -45 lines. mock_game_test exercises both paths (the inline-hook vk
storm and the implicit-layer capture) and passes.
2026-07-12 12:17:30 +02:00

17 KiB