From ae6f26f3efbeec217ce616c0e51d7488614ab558 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Wed, 9 Nov 2016 22:39:53 +0000 Subject: [PATCH] gsdx: Skip texture cache read if any dimension is 0 Fixes a crash at the PSX logo if either the DX9 or DX11 hardware renderer is used. --- plugins/GSdx/GSTextureCache11.cpp | 2 +- plugins/GSdx/GSTextureCache9.cpp | 2 +- plugins/GSdx/GSTextureCacheOGL.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/GSdx/GSTextureCache11.cpp b/plugins/GSdx/GSTextureCache11.cpp index 553c3c1f24..b5f61af5f6 100644 --- a/plugins/GSdx/GSTextureCache11.cpp +++ b/plugins/GSdx/GSTextureCache11.cpp @@ -50,7 +50,7 @@ void GSTextureCache11::Read(Target* t, const GSVector4i& r) return; } - if (!t->m_dirty.empty() || (r.width() == 0 && r.height() == 0)) + if (!t->m_dirty.empty() || r.width() == 0 || r.height() == 0) { return; } diff --git a/plugins/GSdx/GSTextureCache9.cpp b/plugins/GSdx/GSTextureCache9.cpp index a94c154681..6a5b8bd39f 100644 --- a/plugins/GSdx/GSTextureCache9.cpp +++ b/plugins/GSdx/GSTextureCache9.cpp @@ -50,7 +50,7 @@ void GSTextureCache9::Read(Target* t, const GSVector4i& r) return; } - if (!t->m_dirty.empty() || (r.width() == 0 && r.height() == 0)) + if (!t->m_dirty.empty() || r.width() == 0 || r.height() == 0) { return; } diff --git a/plugins/GSdx/GSTextureCacheOGL.cpp b/plugins/GSdx/GSTextureCacheOGL.cpp index f2e066b26c..bfd8cae3ad 100644 --- a/plugins/GSdx/GSTextureCacheOGL.cpp +++ b/plugins/GSdx/GSTextureCacheOGL.cpp @@ -30,7 +30,7 @@ GSTextureCacheOGL::GSTextureCacheOGL(GSRenderer* r) void GSTextureCacheOGL::Read(Target* t, const GSVector4i& r) { - if (!t->m_dirty.empty() || (r.width() == 0 && r.height() == 0)) + if (!t->m_dirty.empty() || r.width() == 0 || r.height() == 0) return; const GIFRegTEX0& TEX0 = t->m_TEX0;