Files
sbox-public/engine/Sandbox.Engine/Systems/Render/Debug/DebugOverlay.cs
Lorenz Junglas 7ba7fa6054 Fix vsync micro stutter and latency when fps_max is set above monitor refresh rate (#5185)
* Add frametime overlay (overlay_fps)

* Fix frame pacing under vsync, regressed by f082791c46

With vsync on and fps_max above the refresh we run ahead of the present queue and stall on it, so frametimes jump around and it stutters even though the average fps looks fine. Clamp the cap to the refresh and pace frames on a fixed grid instead.

Basically restores the refresh clamp and drift compensation f082791c46 removed when it moved fps_max to C#.

Before: https://files.facepunch.com/lolleko/2026/June/26_15-25-SquigglyHuia.mp4
After: https://files.facepunch.com/lolleko/2026/June/26_15-25-DotingAmericanblackvulture.mp4

* Bump default menu refresh rate to 120
2026-06-29 10:16:03 +02:00

3.7 KiB