From 7f20a9363748f07dbaf681e606522d68ec109146 Mon Sep 17 00:00:00 2001 From: BearOso Date: Fri, 7 Jul 2023 13:49:10 -0500 Subject: [PATCH] Don't double-wait. --- vulkan/std_chrono_throttle.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vulkan/std_chrono_throttle.cpp b/vulkan/std_chrono_throttle.cpp index a6cb597f..ddce52cf 100644 --- a/vulkan/std_chrono_throttle.cpp +++ b/vulkan/std_chrono_throttle.cpp @@ -30,7 +30,10 @@ void Throttle::wait_for_frame() auto time_to_wait = remaining(); if (time_to_wait < -frame_duration_us / 10) + { reset(); + return; + } if (time_to_wait.count() > 2000) { @@ -55,7 +58,10 @@ void Throttle::wait_for_frame() auto time_to_wait = remaining(); if (time_to_wait < -frame_duration_us / 10) + { reset(); + return; + } if (time_to_wait.count() > 1000) std::this_thread::sleep_for(time_to_wait - 1ms);