From 0da69055d9f41d838bdf94b66805540c746eaa7d Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Tue, 31 Jan 2023 00:46:10 +1300 Subject: Split out everying remaining from Swap --- Source/Core/VideoCommon/TextureCacheBase.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp') diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 21b58d931e..6029f09c5c 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -769,6 +769,23 @@ void TextureCacheBase::DoLoadState(PointerWrap& p) } } +void TextureCacheBase::OnFrameEnd() +{ + if (m_force_reload_textures.TestAndClear()) + { + ForceReload(); + } + else + { + // Flush any outstanding EFB copies to RAM, in case the game is running at an uncapped frame + // rate and not waiting for vblank. Otherwise, we'd end up with a huge list of pending + // copies. + g_texture_cache->FlushEFBCopies(); + } + + g_texture_cache->Cleanup(g_renderer->m_frame_count); +} + void TCacheEntry::DoState(PointerWrap& p) { p.Do(addr); -- cgit v1.2.3