summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/AsyncRequests.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2020-04-07 19:37:32 +0200
committerJosJuice <josjuice@gmail.com>2020-04-09 11:39:29 +0200
commit812ad4257cf26f2de73aac30a46ac9d573940498 (patch)
treec9017c1ad7cfbb68697b8f29161bcce60f29e0cb /Source/Core/VideoCommon/AsyncRequests.cpp
parent1a42355f96fdc1e63fc183557e6fd574c4e31a75 (diff)
Core: Skip duplicate frames when using frame advance
It used to be the case that frame advance skipped duplicate frames (i.e. it would take 30 frame advances to get through one second of emulated time in a 30 fps game), but this broke in 9c5c3c0. Skipping duplicate frames making TASing less annoying.
Diffstat (limited to 'Source/Core/VideoCommon/AsyncRequests.cpp')
-rw-r--r--Source/Core/VideoCommon/AsyncRequests.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/AsyncRequests.cpp b/Source/Core/VideoCommon/AsyncRequests.cpp
index a824d0020a..9a32b9ad48 100644
--- a/Source/Core/VideoCommon/AsyncRequests.cpp
+++ b/Source/Core/VideoCommon/AsyncRequests.cpp
@@ -97,6 +97,12 @@ void AsyncRequests::PushEvent(const AsyncRequests::Event& event, bool blocking)
}
}
+void AsyncRequests::WaitForEmptyQueue()
+{
+ std::unique_lock<std::mutex> lock(m_mutex);
+ m_cond.wait(lock, [this] { return m_queue.empty(); });
+}
+
void AsyncRequests::SetEnable(bool enable)
{
std::unique_lock<std::mutex> lock(m_mutex);