From b6693c4345fcda37d3f55844875b81556c7a4f29 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 27 Aug 2016 13:57:39 +0200 Subject: [PATCH] gsdx dx/gl: fix depth optimization 4th bit is the fog value, not the depth --- plugins/GSdx/GSRendererDX.cpp | 2 +- plugins/GSdx/GSRendererOGL.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GSRendererDX.cpp b/plugins/GSdx/GSRendererDX.cpp index 140bfa96f5..8f75272880 100644 --- a/plugins/GSdx/GSRendererDX.cpp +++ b/plugins/GSdx/GSRendererDX.cpp @@ -159,7 +159,7 @@ void GSRendererDX::EmulateZbuffer() GSVertex* v = &m_vertex.buff[0]; // Minor optimization of a corner case (it allow to better emulate some alpha test effects) - if (om_dssel.ztst == ZTST_GEQUAL && (m_vt.m_eq.xyzf & 0x8) && v[0].XYZ.Z == max_z) { + if (om_dssel.ztst == ZTST_GEQUAL && (m_vt.m_eq.xyzf & 0x4) && v[0].XYZ.Z == max_z) { #ifdef _DEBUG fprintf(stdout, "Optimize Z test GEQUAL to ALWAYS (%s)\n", psm_str(m_context->ZBUF.PSM)); #endif diff --git a/plugins/GSdx/GSRendererOGL.cpp b/plugins/GSdx/GSRendererOGL.cpp index 5c82b187dd..935f93789d 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -253,7 +253,7 @@ void GSRendererOGL::EmulateZbuffer() GSVertex* v = &m_vertex.buff[0]; // Minor optimization of a corner case (it allow to better emulate some alpha test effects) - if (m_om_dssel.ztst == ZTST_GEQUAL && (m_vt.m_eq.xyzf & 0x8) && v[0].XYZ.Z == max_z) { + if (m_om_dssel.ztst == ZTST_GEQUAL && (m_vt.m_eq.xyzf & 0x4) && v[0].XYZ.Z == max_z) { GL_INS("Optimize Z test GEQUAL to ALWAYS (%s)", psm_str(m_context->ZBUF.PSM)); m_om_dssel.ztst = ZTST_ALWAYS; }