From de0c4a7fc7de489d0499ba82ab0b2dd0b2641b69 Mon Sep 17 00:00:00 2001 From: Kojin Date: Thu, 2 May 2019 13:57:00 -0400 Subject: [PATCH] gsdx-hw: Check for null texture before commit in hacks. (#2951) Issue ##2943 --- plugins/GSdx/Renderers/HW/GSRendererHW.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/GSdx/Renderers/HW/GSRendererHW.cpp b/plugins/GSdx/Renderers/HW/GSRendererHW.cpp index 40dcf74473..1d8753fbfa 100644 --- a/plugins/GSdx/Renderers/HW/GSRendererHW.cpp +++ b/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) { // random battle transition (z buffer written directly, clear it now) - - 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); } @@ -1676,7 +1676,8 @@ bool GSRendererHW::OI_StarWarsForceUnleashed(GSTexture* rt, GSTexture* ds, GSTex { 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); 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)) { - 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); } } @@ -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); // 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_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) { 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); }