Vulkan capture: preserve the game's sync mode, drop the capture throttle
The capture must never change vsync, and must not frame-limit itself. - Removed the ~150 Hz capture throttle from VkCapture. It was wrong: vsync already paces capture (a 144 Hz FIFO game presents 144x/s, so we mirror 144x/s). The only limiter left is ring backpressure (skip a frame if the reaper is behind), which is correctness, not a cap, and never touches the game's present thread or sync mode. - The layer/hook already pass VkSwapchainCreateInfoKHR straight through, so the present mode (= the sync mode) is untouched. Added a presentMode log to prove it. Measured on Sphere Spectacle (direct launch, layer attached): presentMode=2 (FIFO), steady 144.0 fps, and with the throttle gone the mirror now tracks it at 144/s (was capped ~130). The earlier 400-600 fps reading was a direct-launch artifact -- a non-foreground windowed FIFO app isn't throttled by DWM -- not the layer, and not the case through Steam (144). vk_validate now states the mirror follows the present rate (no throttle) and still asserts a present-rate floor. Full suite 21/21. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -288,6 +288,11 @@ VKAPI_ATTR VkResult VKAPI_CALL layer_QueuePresentKHR(VkQueue queue, const VkPres
|
||||
VKAPI_ATTR VkResult VKAPI_CALL layer_CreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* ci,
|
||||
const VkAllocationCallbacks* a, VkSwapchainKHR* out)
|
||||
{
|
||||
// Log the game's chosen present mode (= its sync mode) -- 0 IMMEDIATE, 1 MAILBOX, 2 FIFO (vsync),
|
||||
// 3 FIFO_RELAXED. We pass `ci` straight through, so whatever the game asked for is what it gets;
|
||||
// this proves the layer never changes vsync.
|
||||
logvk("CreateSwapchain: presentMode=%d (0=IMMEDIATE 1=MAILBOX 2=FIFO 3=FIFO_RELAXED) %ux%u minImageCount=%u",
|
||||
static_cast<int>(ci->presentMode), ci->imageExtent.width, ci->imageExtent.height, ci->minImageCount);
|
||||
const VkResult r = g_real_create_swapchain(device, ci, a, out);
|
||||
if (g_active && r == VK_SUCCESS && out && g_get_swapchain_images)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user