mirror of https://github.com/PCSX2/pcsx2.git
GS/HW: Allow previous frame in depth source lookup
Fixes pulling random junk from local memory in Black after adjusting vsync timing.
This commit is contained in:
parent
59cbdc79f5
commit
6f595b7d87
|
@ -148,7 +148,7 @@ GSTextureCache::Source* GSTextureCache::LookupDepthSource(const GIFRegTEX0& TEX0
|
|||
for (auto t : m_dst[RenderTarget])
|
||||
{
|
||||
// FIXME: do I need to allow m_age == 1 as a potential match (as DepthStencil) ???
|
||||
if (!t->m_age && t->m_used && t->m_dirty.empty() && GSUtil::HasSharedBits(bp, psm, t->m_TEX0.TBP0, t->m_TEX0.PSM))
|
||||
if (t->m_age <= 1 && t->m_used && t->m_dirty.empty() && GSUtil::HasSharedBits(bp, psm, t->m_TEX0.TBP0, t->m_TEX0.PSM))
|
||||
{
|
||||
ASSERT(GSLocalMemory::m_psm[t->m_TEX0.PSM].depth);
|
||||
dst = t;
|
||||
|
@ -504,7 +504,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
|
|||
// 1/ Check only current frame, I guess it is only used as a postprocessing effect
|
||||
for (auto t : m_dst[DepthStencil])
|
||||
{
|
||||
if (!t->m_age && t->m_used && t->m_dirty.empty() && GSUtil::HasSharedBits(bp, psm, t->m_TEX0.TBP0, t->m_TEX0.PSM))
|
||||
if (t->m_age <= 1 && t->m_used && t->m_dirty.empty() && GSUtil::HasSharedBits(bp, psm, t->m_TEX0.TBP0, t->m_TEX0.PSM))
|
||||
{
|
||||
GL_INS("TC: Warning depth format read as color format. Pixels will be scrambled");
|
||||
// Let's fetch a depth format texture. Rational, it will avoid the texture allocation and the
|
||||
|
|
Loading…
Reference in New Issue