Skip to content

Commit

Permalink
GS/HW: Don't kill old targets unless completely dirty or targets overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Jun 12, 2024
1 parent 08e8248 commit ece3780
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pcsx2/GS/Renderers/HW/GSTextureCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4296,7 +4296,7 @@ void GSTextureCache::IncAge()

AgeHashCache();

// As of 04/15/2024 this is s et to 60 (just 1 second of targets), which should be fine now as it doesn't destroy targets which haven't been coevred.
// As of 04/15/2024 this is s et to 60 (just 1 second of targets), which should be fine now as it doesn't destroy targets which haven't been covered.
//
// For reference, here are some games sensitive to killing old targets:
// Original maxage was 4 here, Xenosaga 2 needs at least 240, else it flickers on scene transitions.
Expand All @@ -4318,7 +4318,7 @@ void GSTextureCache::IncAge()
{
const Target* overlapping_tgt = FindOverlappingTarget(t);

if (!t->m_dirty.empty() || overlapping_tgt != nullptr)
if (overlapping_tgt != nullptr || t->m_dirty.GetTotalRect(t->m_TEX0, GSVector2i(t->m_valid.width(), t->m_valid.height())).rintersect(t->m_valid).eq(t->m_valid))
{
i = list.erase(i);
GL_CACHE("TC: Remove Target(%s): (0x%x) due to age", to_string(type),
Expand Down

0 comments on commit ece3780

Please sign in to comment.