Skip to content
Permalink
Browse files

gsdx-hw: Check for null texture before commit in hacks. (#2951)

Issue ##2943
  • Loading branch information...
tadanokojin authored and lightningterror committed May 2, 2019
1 parent 5a69a2f commit de0c4a7fc7de489d0499ba82ab0b2dd0b2641b69
Showing with 10 additions and 6 deletions.
  1. +10 −6 plugins/GSdx/Renderers/HW/GSRendererHW.cpp
@@ -1586,8 +1586,8 @@ bool GSRendererHW::OI_FFX(GSTexture* rt, GSTexture* ds, GSTextureCache::Source*
if((FBP == 0x00d00 || FBP == 0x00000) && ZBP == 0x02100 && PRIM->TME && TBP == 0x01a00 && m_context->TEX0.PSM == PSM_PSMCT16S) if((FBP == 0x00d00 || FBP == 0x00000) && ZBP == 0x02100 && PRIM->TME && TBP == 0x01a00 && m_context->TEX0.PSM == PSM_PSMCT16S)
{ {
// random battle transition (z buffer written directly, clear it now) // random battle transition (z buffer written directly, clear it now)

if(ds)
ds->Commit(); // Don't bother to save few MB for a single game ds->Commit(); // Don't bother to save few MB for a single game
m_dev->ClearDepth(ds); m_dev->ClearDepth(ds);
} }


@@ -1676,7 +1676,8 @@ bool GSRendererHW::OI_StarWarsForceUnleashed(GSTexture* rt, GSTexture* ds, GSTex
{ {
if(FPSM == PSM_PSMCT24 && FBP == 0x2bc0) if(FPSM == PSM_PSMCT24 && FBP == 0x2bc0)
{ {
ds->Commit(); // Don't bother to save few MB for a single game if(ds)
ds->Commit(); // Don't bother to save few MB for a single game
m_dev->ClearDepth(ds); m_dev->ClearDepth(ds);


return false; return false;
@@ -1686,7 +1687,8 @@ bool GSRendererHW::OI_StarWarsForceUnleashed(GSTexture* rt, GSTexture* ds, GSTex
{ {
if((FBP == 0x0 || FBP == 0x01180) && FPSM == PSM_PSMCT32 && (m_vt.m_eq.z && m_vt.m_max.p.z == 0)) if((FBP == 0x0 || FBP == 0x01180) && FPSM == PSM_PSMCT32 && (m_vt.m_eq.z && m_vt.m_max.p.z == 0))
{ {
ds->Commit(); // Don't bother to save few MB for a single game if(ds)
ds->Commit(); // Don't bother to save few MB for a single game
m_dev->ClearDepth(ds); m_dev->ClearDepth(ds);
} }
} }
@@ -1771,7 +1773,8 @@ bool GSRendererHW::OI_SuperManReturns(GSTexture* rt, GSTexture* ds, GSTextureCac
ASSERT((v->RGBAQ.A << 24 | v->RGBAQ.B << 16 | v->RGBAQ.G << 8 | v->RGBAQ.R) == (int)v->XYZ.Z); ASSERT((v->RGBAQ.A << 24 | v->RGBAQ.B << 16 | v->RGBAQ.G << 8 | v->RGBAQ.R) == (int)v->XYZ.Z);


// Do a direct write // Do a direct write
rt->Commit(); // Don't bother to save few MB for a single game if(rt)
rt->Commit(); // Don't bother to save few MB for a single game
m_dev->ClearRenderTarget(rt, GSVector4(m_vt.m_min.c)); m_dev->ClearRenderTarget(rt, GSVector4(m_vt.m_min.c));


m_tc->InvalidateVideoMemType(GSTextureCache::DepthStencil, ctx->FRAME.Block()); m_tc->InvalidateVideoMemType(GSTextureCache::DepthStencil, ctx->FRAME.Block());
@@ -1806,7 +1809,8 @@ bool GSRendererHW::OI_ArTonelico2(GSTexture* rt, GSTexture* ds, GSTextureCache::


if (m_vertex.next == 2 && !PRIM->TME && m_context->FRAME.FBW == 10 && v->XYZ.Z == 0 && m_context->TEST.ZTST == ZTST_ALWAYS) { if (m_vertex.next == 2 && !PRIM->TME && m_context->FRAME.FBW == 10 && v->XYZ.Z == 0 && m_context->TEST.ZTST == ZTST_ALWAYS) {
GL_INS("OI_ArTonelico2"); GL_INS("OI_ArTonelico2");
ds->Commit(); // Don't bother to save few MB for a single game if(ds)
ds->Commit(); // Don't bother to save few MB for a single game
m_dev->ClearDepth(ds); m_dev->ClearDepth(ds);
} }


0 comments on commit de0c4a7

Please sign in to comment.
You can’t perform that action at this time.