GS/HW: Don't try to double-buffer preload depth targets

Spec violations if we do.
This commit is contained in:
Stenzek 2023-12-10 15:09:10 +10:00 committed by Connor McLaughlin
parent b0c3a1e23f
commit 78f751959d
1 changed files with 65 additions and 61 deletions

View File

@ -2280,6 +2280,9 @@ bool GSTextureCache::PreloadTarget(GIFRegTEX0 TEX0, const GSVector2i& size, cons
dst->UpdateValidity(GSVector4i::loadh(valid_size));
// Can't do channel writes to depth targets, and DirectX can't partial copy depth targets.
if (psm_s.depth == 0)
{
for (int type = 0; type < 2; type++)
{
auto& list = m_dst[type];
@ -2289,7 +2292,7 @@ bool GSTextureCache::PreloadTarget(GIFRegTEX0 TEX0, const GSVector2i& size, cons
Target* t = *j;
if (dst != t && t->m_TEX0.TBW == dst->m_TEX0.TBW && t->m_TEX0.PSM == dst->m_TEX0.PSM && t->m_TEX0.TBW > 4)
if(t->Overlaps(dst->m_TEX0.TBP0, dst->m_TEX0.TBW, dst->m_TEX0.PSM, dst->m_valid))
if (t->Overlaps(dst->m_TEX0.TBP0, dst->m_TEX0.TBW, dst->m_TEX0.PSM, dst->m_valid))
{
// could be overwriting a double buffer, so if it's the second half of it, just reduce the size down to half.
if (((((t->UnwrappedEndBlock() + 1) - t->m_TEX0.TBP0) >> 1) + t->m_TEX0.TBP0) == dst->m_TEX0.TBP0)
@ -2357,6 +2360,7 @@ bool GSTextureCache::PreloadTarget(GIFRegTEX0 TEX0, const GSVector2i& size, cons
i++;
}
}
}
return hw_clear;
}