From c2e851b3a55d51f8fa90e1a40f8f17ecb789a888 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 4 Jun 2015 09:54:07 +0200 Subject: [PATCH] gsdx-ogl: don't use slow SW blend for nothing When A == B, coeff is 0 so <= 1 When C == 2, just check the value of coeff Barely faster in accurate_blend = 2 --- 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 d334421a5a..6aae7614b2 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -613,7 +613,8 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour // Compute the blending equation to detect special case int blend_sel = ((om_bsel.a * 3 + om_bsel.b) * 3 + om_bsel.c) * 3 + om_bsel.d; int bogus_blend = GSDeviceOGL::m_blendMapD3D9[blend_sel].bogus; - bool sw_blending = (m_accurate_blend && (bogus_blend & A_MAX)) || acc_colclip_wrap || (m_accurate_blend > 1); + bool all_sw = !( (ALPHA.A == ALPHA.B) || (ALPHA.C == 2 && afix <= 1.002f) ) && (m_accurate_blend > 1); + bool sw_blending = (m_accurate_blend && (bogus_blend & A_MAX)) || acc_colclip_wrap || all_sw; if (sw_blending && om_bsel.abe) { GL_INS("!!! SW blending effect used (0x%x from sel %d) !!!", bogus_blend, blend_sel);