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:
2026-06-23 08:48:44 +02:00
parent d4412ff610
commit 9fee13789d
5 changed files with 30 additions and 35 deletions

View File

@@ -422,9 +422,9 @@ int main(int argc, char** argv)
// Performance gate (this is the check the earlier version refused to make -- it reported the rate
// and rationalized it, which hid the 144->3 FPS stall). The capture runs off the present thread,
// so the game must keep a healthy present rate while we mirror. present_calls counts EVERY present
// (not throttled); the mirror is intentionally throttled to ~150 Hz, so copied < present is normal
// and not a drop. A present rate that collapses (the bug was ~3/s) fails here.
// so the game must keep a healthy present rate while we mirror. The capture is NOT throttled --
// it follows the present rate, which vsync paces -- so the mirror rate tracks the present rate. A
// present rate that collapses (the bug was ~3/s) fails here.
if (alive && find_pid(L"sphere.exe") == pid)
{
const std::uint64_t p0 = block->video.present_calls;
@@ -437,7 +437,7 @@ int main(int argc, char** argv)
// so its delta is the true mirror rate even while we're just sleeping here.
const double mirror = static_cast<double>(g1 - g0) / 3.0;
std::printf(" present rate while capturing = %.1f /s; mirror rate = %.1f /s (capture is off the "
"present thread + throttled)\n",
"present thread; the mirror follows the present rate -- vsync paces it)\n",
fps, mirror);
check(fps > 30.0, "game keeps a healthy present rate while capturing (no present-thread stall)");
}