Merge pull request #8730 from JosJuice/frame-advance-duplicate-frame

Core: Skip duplicate frames when using frame advance
This commit is contained in:
JMC47
2020-04-16 18:29:16 -04:00
committed by GitHub
6 changed files with 65 additions and 39 deletions

View File

@ -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);

View File

@ -82,6 +82,7 @@ public:
PullEventsInternal();
}
void PushEvent(const Event& event, bool blocking = false);
void WaitForEmptyQueue();
void SetEnable(bool enable);
void SetPassthrough(bool enable);

View File

@ -1309,7 +1309,7 @@ void Renderer::Swap(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height, u6
{
// Remove stale EFB/XFB copies.
g_texture_cache->Cleanup(m_frame_count);
Core::Callback_VideoCopiedToXFB(true);
Core::Callback_FramePresented();
}
// Handle any config changes, this gets propogated to the backend.