diff --git a/plugins/GSdx/GLLoader.cpp b/plugins/GSdx/GLLoader.cpp index 0dd1ed69ea199..f514e8de67dba 100644 --- a/plugins/GSdx/GLLoader.cpp +++ b/plugins/GSdx/GLLoader.cpp @@ -342,18 +342,15 @@ namespace GLLoader { // Name changed but driver is still bad! if (strstr(vendor, "Advanced Micro Devices") || strstr(vendor, "ATI Technologies Inc.") || strstr(vendor, "ATI")) vendor_id_amd = true; - /*if (vendor_id_amd && ( - strstr((const char*)&s[v], " 10.") || // Blacklist all 2010 AMD drivers. - strstr((const char*)&s[v], " 11.") || // Blacklist all 2011 AMD drivers. - strstr((const char*)&s[v], " 12.") || // Blacklist all 2012 AMD drivers. - strstr((const char*)&s[v], " 13.") || // Blacklist all 2013 AMD drivers. - strstr((const char*)&s[v], " 14.") || // Blacklist all 2014 AMD drivers. - strstr((const char*)&s[v], " 15.") || // Blacklist all 2015 AMD drivers. - strstr((const char*)&s[v], " 16.") || // Blacklist all 2016 AMD drivers. - strstr((const char*)&s[v], " 17.") // Blacklist all 2017 AMD drivers for now. - )) + if (vendor_id_amd && ( + // Idea is to also have a working 2015 legacy driver so while we are at it why not blacklist older versions just in case. + // This should affect only Catalyst drivers. + strstr((const char*)&s[v], "atiumdag") || + strstr((const char*)&s[v], "14.") || + strstr((const char*)&s[v], "15."))) + amd_legacy_buggy_driver = true; - */ + if (strstr(vendor, "NVIDIA Corporation")) vendor_id_nvidia = true; @@ -365,7 +362,7 @@ namespace GLLoader { mesa_driver = !vendor_id_nvidia && !vendor_id_amd; #endif - buggy_sso_dual_src = vendor_id_intel || vendor_id_amd /*|| amd_legacy_buggy_driver*/; + buggy_sso_dual_src = vendor_id_intel || vendor_id_amd && !amd_legacy_buggy_driver; if (theApp.GetConfigI("override_geometry_shader") != -1) { found_geometry_shader = theApp.GetConfigB("override_geometry_shader"); diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index adaa53d50a978..8fba59bc1015f 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -1747,13 +1747,29 @@ void GSDeviceOGL::OMSetBlendState(uint8 blend_index, uint8 blend_factor, bool is if (GLState::eq_RGB != b.op) { GLState::eq_RGB = b.op; - glBlendEquationSeparate(b.op, GL_FUNC_ADD); + glBlendEquationSeparateiARB(0, b.op, GL_FUNC_ADD); } if (GLState::f_sRGB != b.src || GLState::f_dRGB != b.dst) { GLState::f_sRGB = b.src; GLState::f_dRGB = b.dst; - glBlendFuncSeparate(b.src, b.dst, GL_ONE, GL_ZERO); + + // Catalyst legacy 2015 and older doesn't like the new SSO partial workaround so let's use the old workaround to get a partially working gl render. + // Some elements are semi transparent but it's better than having a white screen. + uint16 src = b.src; + uint16 dst = b.dst; + if (GLLoader::amd_legacy_buggy_driver) { + if (src == GL_SRC1_ALPHA) + src = GL_SRC_ALPHA; + else if (src == GL_ONE_MINUS_SRC1_ALPHA) + src = GL_ONE_MINUS_SRC_ALPHA; + + if (dst == GL_SRC1_ALPHA) + dst = GL_SRC_ALPHA; + else if (dst == GL_ONE_MINUS_SRC1_ALPHA) + dst = GL_ONE_MINUS_SRC_ALPHA; + } + glBlendFuncSeparateiARB(0, src, dst, GL_ONE, GL_ZERO); } } else { diff --git a/plugins/GSdx/GSWnd.cpp b/plugins/GSdx/GSWnd.cpp index 4c6f777e6de81..c95fce19a9768 100644 --- a/plugins/GSdx/GSWnd.cpp +++ b/plugins/GSdx/GSWnd.cpp @@ -95,6 +95,9 @@ void GSWndGL::PopulateGlFunction() GL_EXT_LOAD_OPT(glGetInteger64v); GL_EXT_LOAD_OPT(glCreateQueries); GL_EXT_LOAD_OPT(glDeleteQueries); + // GL4.0 + GL_EXT_LOAD_OPT(glBlendEquationSeparateiARB); + GL_EXT_LOAD_OPT(glBlendFuncSeparateiARB); // GL4.1 GL_EXT_LOAD(glCreateShaderProgramv); GL_EXT_LOAD(glBindProgramPipeline);