From bc5de8df6bb04219d9879cf94d801557c6ffc8ef Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 8 May 2015 19:31:49 +0200 Subject: [PATCH] gsdx-ogl: disable FF blend when blend is done in shader --- plugins/GSdx/GSTextureFXOGL.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/GSdx/GSTextureFXOGL.cpp b/plugins/GSdx/GSTextureFXOGL.cpp index b156c99279..b83df69c78 100644 --- a/plugins/GSdx/GSTextureFXOGL.cpp +++ b/plugins/GSdx/GSTextureFXOGL.cpp @@ -103,23 +103,24 @@ GSBlendStateOGL* GSDeviceOGL::CreateBlend(OMBlendSelector bsel, uint8 afix) { int i = ((bsel.a * 3 + bsel.b) * 3 + bsel.c) * 3 + bsel.d; - bs->EnableBlend(); bs->SetRGB(m_blendMapD3D9[i].op, m_blendMapD3D9[i].src, m_blendMapD3D9[i].dst); bs->SetBogus(m_blendMapD3D9[i].bogus); - if(m_blendMapD3D9[i].bogus == 1) - { - if (bsel.a == 0) - bs->SetRGB(m_blendMapD3D9[i].op, GL_ONE, m_blendMapD3D9[i].dst); - else - bs->SetRGB(m_blendMapD3D9[i].op, m_blendMapD3D9[i].src, GL_ONE); + if (m_blendMapD3D9[i].bogus > 2) { + if (!theApp.GetConfig("accurate_blend", 0)) { + bs->EnableBlend(); + if (bsel.a == 0) + bs->SetRGB(m_blendMapD3D9[i].op, GL_ONE, m_blendMapD3D9[i].dst); + else + bs->SetRGB(m_blendMapD3D9[i].op, m_blendMapD3D9[i].src, GL_ONE); + } const string afixstr = format("%d >> 7", afix); const char *col[3] = {"Cs", "Cd", "0"}; const char *alpha[3] = {"As", "Ad", afixstr.c_str()}; - - // FIXME, need to investigate OGL capabilities. Maybe for OGL5 ;) fprintf(stderr, "Impossible blend for D3D: (%s - %s) * %s + %s\n", col[bsel.a], col[bsel.b], alpha[bsel.c], col[bsel.d]); + } else { + bs->EnableBlend(); } // Not very good but I don't wanna write another 81 row table