From 1c600c7068a01ec40ad89a8f58e308c496571d29 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 26 Mar 2023 17:57:42 +1000 Subject: [PATCH] GS/HW: Remove m_used from SourceMap Not used anymore, since we don't age the TC when there's no draws. --- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 9 ++------- pcsx2/GS/Renderers/HW/GSTextureCache.h | 8 -------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index 56c1a71bed..04b101d48f 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -1062,9 +1062,6 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con } src->Update(r); - - m_src.m_used = true; - return src; } @@ -2707,8 +2704,8 @@ void GSTextureCache::InvalidateSourcesFromTarget(const Target* t) void GSTextureCache::IncAge() { - const int max_age = m_src.m_used ? 3 : 6; - const int max_preload_age = m_src.m_used ? 30 : 60; + static constexpr int max_age = 3; + static constexpr int max_preload_age = 30; // You can't use m_map[page] because Source* are duplicated on several pages. for (auto i = m_src.m_surfaces.begin(); i != m_src.m_surfaces.end();) @@ -2740,8 +2737,6 @@ void GSTextureCache::IncAge() } } - m_src.m_used = false; - // Clearing of Rendertargets causes flickering in many scene transitions. // Sigh, this seems to be used to invalidate surfaces. So set a huge maxage to avoid flicker, // but still invalidate surfaces. (Disgaea 2 fmv when booting the game through the BIOS) diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.h b/pcsx2/GS/Renderers/HW/GSTextureCache.h index 7eece23e48..031ca25d19 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.h +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.h @@ -316,14 +316,6 @@ public: public: std::unordered_set m_surfaces; std::array, MAX_PAGES> m_map; - u32 m_pages[16]; // bitmap of all pages - bool m_used; - - SourceMap() - : m_used(false) - { - memset(m_pages, 0, sizeof(m_pages)); - } void Add(Source* s, const GIFRegTEX0& TEX0, const GSOffset& off); void RemoveAll();