From 06f8641363b553021a46b5f9cae6488d82ed176d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hor=C3=A1=C4=8Dek?= Date: Wed, 4 Nov 2020 11:35:29 +0100 Subject: [PATCH] Fix for FPS limit breaking Fixes #127 --- src/vulkan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan.cpp b/src/vulkan.cpp index 3e419673..ed78179c 100644 --- a/src/vulkan.cpp +++ b/src/vulkan.cpp @@ -2425,7 +2425,7 @@ void FpsLimiter(struct fps_limit& stats){ auto adjustedSleep = stats.sleepTime - stats.frameOverhead; this_thread::sleep_for(adjustedSleep); stats.frameOverhead = ((Clock::now() - stats.frameStart) - adjustedSleep); - if (stats.frameOverhead > stats.targetFrameTime) + if (stats.frameOverhead > stats.targetFrameTime / 2) stats.frameOverhead = Clock::duration(0); } }