GS/TextureCache: Fix target not getting invalidated in some cases

This would happen when there was a source from local memory with the
same pointer as the target.

Fixes sky getting messed up in the Jak 3 menu when the hash cache is
enabled.
This commit is contained in:
Connor McLaughlin 2022-02-23 21:10:06 +10:00 committed by refractionpcsx2
parent ff75ab73cc
commit 2eaba084c7
1 changed files with 4 additions and 2 deletions

View File

@ -754,6 +754,10 @@ void GSTextureCache::InvalidateVideoMem(const GSOffset& off, const GSVector4i& r
if (!s->m_target)
{
found |= b;
// No point keeping invalidated sources around when the hash cache is active,
// we can just re-hash and create a new source from the cached texture.
if (s->m_from_hash_cache || (m_disable_partial_invalidation && s->m_repeating))
{
m_src.RemoveAt(s);
@ -780,8 +784,6 @@ void GSTextureCache::InvalidateVideoMem(const GSOffset& off, const GSVector4i& r
}
s->m_complete_layers = 0;
found |= b;
}
}
else