From 5b72fab2e429d23ec93c5ddf13bc5952da448ade Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Mon, 3 Oct 2016 18:32:54 +0200 Subject: [PATCH] gsdx ogl: depth regression from 866173a481d2387f01c9a13bad98c5e2c1f92baf Only mask depth if the min value is too big Issue #1602 --- plugins/GSdx/GSRendererOGL.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/GSdx/GSRendererOGL.cpp b/plugins/GSdx/GSRendererOGL.cpp index a585cdbf03..67181588a7 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -266,7 +266,7 @@ void GSRendererOGL::EmulateZbuffer() // The real GS appears to do no masking based on the Z buffer format and writing larger Z values // than the buffer supports seems to be an error condition on the real GS, causing it to crash. // We are probably receiving bad coordinates from VU1 in these cases. - vs_cb.DepthMask = GSVector2i(max_z, max_z); + vs_cb.DepthMask = GSVector2i(0xFFFFFFFF, 0xFFFFFFFF); if (m_om_dssel.ztst >= ZTST_ALWAYS && m_om_dssel.zwe && (m_context->ZBUF.PSM != PSM_PSMZ32)) { if (m_vt.m_max.p.z > max_z) { @@ -274,6 +274,7 @@ void GSRendererOGL::EmulateZbuffer() // Fixme :Following conditional fixes some dialog frame in Wild Arms 3, but may not be what was intended. if (m_vt.m_min.p.z > max_z) { GL_INS("Bad Z size on %s buffers", psm_str(m_context->ZBUF.PSM)); + vs_cb.DepthMask = GSVector2i(max_z, max_z); m_om_dssel.ztst = ZTST_ALWAYS; } }