mirror of https://github.com/PCSX2/pcsx2.git
gsdx-tc: fix a memory leak when depth isn't fully supported
Fix issue #642
This commit is contained in:
parent
875be67a7e
commit
8be32e4661
|
@ -1488,6 +1488,17 @@ void GSTextureCache::Target::Update()
|
||||||
|
|
||||||
if (r.rempty()) return;
|
if (r.rempty()) return;
|
||||||
|
|
||||||
|
// No handling please
|
||||||
|
if ((m_type == DepthStencil) && !m_depth_supported) {
|
||||||
|
// do the most likely thing a direct write would do, clear it
|
||||||
|
GL_INS("ERROR: Update DepthStencil dummy");
|
||||||
|
|
||||||
|
if((m_renderer->m_game.flags & CRC::ZWriteMustNotClear) == 0)
|
||||||
|
m_renderer->m_dev->ClearDepth(m_texture, 0);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int w = r.width();
|
int w = r.width();
|
||||||
int h = r.height();
|
int h = r.height();
|
||||||
|
|
||||||
|
@ -1500,17 +1511,6 @@ void GSTextureCache::Target::Update()
|
||||||
GSTexture* t = m_renderer->m_dev->CreateTexture(w, h);
|
GSTexture* t = m_renderer->m_dev->CreateTexture(w, h);
|
||||||
if (t == NULL) return;
|
if (t == NULL) return;
|
||||||
|
|
||||||
// No handling please
|
|
||||||
if ((m_type == DepthStencil) && !m_depth_supported) {
|
|
||||||
// do the most likely thing a direct write would do, clear it
|
|
||||||
GL_INS("ERROR: Update DepthStencil dummy");
|
|
||||||
|
|
||||||
if((m_renderer->m_game.flags & CRC::ZWriteMustNotClear) == 0)
|
|
||||||
m_renderer->m_dev->ClearDepth(m_texture, 0);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const GSOffset* off = m_renderer->m_mem.GetOffset(m_TEX0.TBP0, m_TEX0.TBW, m_TEX0.PSM);
|
const GSOffset* off = m_renderer->m_mem.GetOffset(m_TEX0.TBP0, m_TEX0.TBW, m_TEX0.PSM);
|
||||||
|
|
||||||
GSTexture::GSMap m;
|
GSTexture::GSMap m;
|
||||||
|
|
Loading…
Reference in New Issue