From dcfb6a56b3e1b55e510548f00f9065b6d2a15826 Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Thu, 24 Sep 2020 21:59:31 +0200 Subject: [PATCH] gsdx-ogl: Move DATE_GL42 swap code after colclip. We can avoid adding extra conditions this way. --- .../GSdx/Renderers/OpenGL/GSRendererOGL.cpp | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/plugins/GSdx/Renderers/OpenGL/GSRendererOGL.cpp b/plugins/GSdx/Renderers/OpenGL/GSRendererOGL.cpp index 43b9a2f2a2..25c39549b2 100644 --- a/plugins/GSdx/Renderers/OpenGL/GSRendererOGL.cpp +++ b/plugins/GSdx/Renderers/OpenGL/GSRendererOGL.cpp @@ -513,18 +513,6 @@ void GSRendererOGL::EmulateBlending(bool& DATE_GL42, bool& DATE_GL45) default: /*sw_blending |= accumulation_blend*/; } - // SW Blending - // GL42 interact very badly with sw blending. GL42 uses the primitiveID to find the primitive - // that write the bad alpha value. Sw blending will force the draw to run primitive by primitive - // (therefore primitiveID will be constant to 1). - // Switch DATE_GL42 with DATE_GL45 in such cases to ensure accuracy. - // No mix of COLCLIP + sw blend + DATE_GL42, neither sw fbmask + DATE_GL42. - if ((((accumulation_blend || blend_non_recursive) && m_env.COLCLAMP.CLAMP == 0) || sw_blending) && DATE_GL42) { - GL_PERF("DATE: Swap DATE_GL42 with DATE_GL45"); - m_require_full_barrier = true; - DATE_GL42 = false; - DATE_GL45 = true; - } // Color clip if (m_env.COLCLAMP.CLAMP == 0) { @@ -555,6 +543,19 @@ void GSRendererOGL::EmulateBlending(bool& DATE_GL42, bool& DATE_GL45) } } + // GL42 interact very badly with sw blending. GL42 uses the primitiveID to find the primitive + // that write the bad alpha value. Sw blending will force the draw to run primitive by primitive + // (therefore primitiveID will be constant to 1). + // Switch DATE_GL42 with DATE_GL45 in such cases to ensure accuracy. + // No mix of COLCLIP + sw blend + DATE_GL42, neither sw fbmask + DATE_GL42. + // Note: Do the swap after colclip to avoid adding extra conditions. + if (sw_blending && DATE_GL42) { + GL_PERF("DATE: Swap DATE_GL42 with DATE_GL45"); + m_require_full_barrier = true; + DATE_GL42 = false; + DATE_GL45 = true; + } + // For stat to optimize accurate option #if 0 GL_INS("BLEND_INFO: %d/%d/%d/%d. Clamp:%d. Prim:%d number %d (drawlist %d) (sw %d)",