Skip to content

Commit

Permalink
Numeric-based AMD driver version check
Browse files Browse the repository at this point in the history
Also account for latest release bug fixes (see PCSX2#1552 for details on the used values)
Legacy_driver variable was left there, because technically speaking that'd be supposed to be yet another case to remotely care
  • Loading branch information
mirh committed Nov 22, 2018
1 parent a602f45 commit a8b5ebd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
27 changes: 22 additions & 5 deletions plugins/GSdx/Renderers/OpenGL/GLLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ namespace GLLoader {
bool s_first_load = true;

bool amd_legacy_buggy_driver = false;
bool amd_buggy_driver = false;
bool vendor_id_amd = false;
bool vendor_id_nvidia = false;
bool vendor_id_intel = false;
Expand Down Expand Up @@ -337,11 +338,27 @@ namespace GLLoader {
fprintf(stdout, "OpenGL information. GPU: %s. Vendor: %s. Driver: %s\n", glGetString(GL_RENDERER), vendor, &s[0]);

// 32-bit driver should always actually just report the former
if (strstr(vendor, "ATI Technologies Inc.") || strstr(vendor, "Advanced Micro Devices") || strstr(vendor, "ATI"))
if (strstr(vendor, "ATI Technologies Inc.") || strstr(vendor, "Advanced Micro Devices") || strstr(vendor, "ATI")) {
vendor_id_amd = true;
/*if (vendor_id_amd)
amd_legacy_buggy_driver = true;
*/
// AMD's GL_version is made of: <OpenGL version number> <requested context> <DriverVersion>
// Technically speaking we'd just be interested in the atioglxx/fglrx_dri userspace lib
// (whose revision number is comfortably exposed in the first element of the string above)
// Unfortuntately after testing for at least these 2 cases we check, I found that had same
// versions across the buggy and fixed "branch". Threfore look for the kernel driver build.
//
// Screw Wx screwings (it's nice we have decimal separator localized... but dlls do not)
char* pEnd;
#ifdef _WIN32
GLfloat v = _strtof_l(strrchr((char*)s, ' '), &pEnd, _create_locale(LC_NUMERIC, "C"));
#else
GLfloat v = strtof_l(strrchr((char*)s, ' '), &pEnd, newlocale(LC_NUMERIC, "C", NULL));
#endif
/*if (v < 15.3f)
amd_legacy_buggy_driver = true;
*/
if (v < 25.20f || (v < 25.21f && atoi(pEnd + 1) < 1407))
amd_buggy_driver = true;
}
if (strstr(vendor, "NVIDIA Corporation"))
vendor_id_nvidia = true;

Expand All @@ -353,7 +370,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 || amd_buggy_driver /*|| amd_legacy_buggy_driver*/;

if (theApp.GetConfigI("override_geometry_shader") != -1) {
found_geometry_shader = theApp.GetConfigB("override_geometry_shader");
Expand Down
1 change: 1 addition & 0 deletions plugins/GSdx/Renderers/OpenGL/GLLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ namespace GLLoader {
extern bool vendor_id_nvidia;
extern bool vendor_id_intel;
extern bool amd_legacy_buggy_driver;
extern bool amd_buggy_driver;
extern bool mesa_driver;
extern bool buggy_sso_dual_src;
extern bool in_replayer;
Expand Down

0 comments on commit a8b5ebd

Please sign in to comment.