gsdx ogl: reduce complexity of driver detection

This commit is contained in:
Gregory Hainaut 2016-10-23 12:42:54 +02:00
parent 565cb70875
commit 885ef7a46f
3 changed files with 11 additions and 12 deletions

View File

@ -194,7 +194,7 @@ namespace GLLoader {
bool legacy_fglrx_buggy_driver = false;
bool fglrx_buggy_driver = false;
bool mesa_amd_buggy_driver = false;
bool mesa_buggy_driver = false;
bool nvidia_buggy_driver = false;
bool intel_buggy_driver = false;
bool in_replayer = false;
@ -270,21 +270,20 @@ namespace GLLoader {
strstr((const char*)&s[v], " 15.") // blacklist all 2015 drivers
|| strstr((const char*)&s[v], " 16.1"))) // And start of 2016
legacy_fglrx_buggy_driver = true;
if (strstr(vendor, "NVIDIA Corporation"))
nvidia_buggy_driver = true;
if (strstr(vendor, "Intel"))
intel_buggy_driver = true;
if (strstr(vendor, "X.Org") || strstr(vendor, "nouveau")) // Note: it might actually catch nouveau too, but bugs are likely to be the same anyway
mesa_amd_buggy_driver = true;
if (strstr(vendor, "VMware")) // Assume worst case because I don't know the real status
mesa_amd_buggy_driver = intel_buggy_driver = true;
#ifdef _WIN32
buggy_sso_dual_src = intel_buggy_driver || legacy_fglrx_buggy_driver;
if (strstr(vendor, "Intel"))
intel_buggy_driver = true;
#else
buggy_sso_dual_src = legacy_fglrx_buggy_driver;
// On linux assumes the free driver if it isn't nvidia or amd pro driver
mesa_buggy_driver = !nvidia_buggy_driver && !fglrx_buggy_driver;
#endif
buggy_sso_dual_src = intel_buggy_driver || legacy_fglrx_buggy_driver;
if (theApp.GetConfigI("override_geometry_shader") != -1) {
found_geometry_shader = theApp.GetConfigB("override_geometry_shader");
fprintf(stderr, "Overriding geometry shaders detection\n");

View File

@ -353,7 +353,7 @@ namespace GLLoader {
extern bool fglrx_buggy_driver;
extern bool legacy_fglrx_buggy_driver;
extern bool mesa_amd_buggy_driver;
extern bool mesa_buggy_driver;
extern bool nvidia_buggy_driver;
extern bool intel_buggy_driver;
extern bool buggy_sso_dual_src;

View File

@ -1013,7 +1013,7 @@ void GSDeviceOGL::SelfShaderTestRun(const string& dir, const string& file, const
#ifdef __linux__
// Nouveau actually
if (GLLoader::mesa_amd_buggy_driver) {
if (GLLoader::mesa_buggy_driver) {
if (freopen(out.c_str(), "w", stderr) == NULL)
fprintf(stderr, "Failed to redirect stderr\n");
}
@ -1025,7 +1025,7 @@ void GSDeviceOGL::SelfShaderTestRun(const string& dir, const string& file, const
#ifdef __linux__
// Nouveau actually
if (GLLoader::mesa_amd_buggy_driver) {
if (GLLoader::mesa_buggy_driver) {
if (freopen("/dev/tty", "w", stderr) == NULL)
fprintf(stderr, "Failed to restore stderr\n");
}