gsdx: only print once OpenGL status message

All credits go to @lightningterror

Fix #1882
This commit is contained in:
Gregory Hainaut 2017-05-11 22:35:31 +02:00
parent 0939424574
commit ec63b04719
3 changed files with 25 additions and 14 deletions

View File

@ -264,6 +264,8 @@ namespace Emulate_DSA {
namespace GLLoader { namespace GLLoader {
bool s_first_load = true;
bool legacy_fglrx_buggy_driver = false; bool legacy_fglrx_buggy_driver = false;
bool fglrx_buggy_driver = false; bool fglrx_buggy_driver = false;
bool mesa_buggy_driver = false; bool mesa_buggy_driver = false;
@ -304,11 +306,13 @@ namespace GLLoader {
return found; return found;
} }
if (s_first_load) {
if (!found) { if (!found) {
fprintf(stdout, "INFO: %s is NOT SUPPORTED\n", name.c_str()); fprintf(stdout, "INFO: %s is NOT SUPPORTED\n", name.c_str());
} else { } else {
fprintf(stdout, "INFO: %s is available\n", name.c_str()); fprintf(stdout, "INFO: %s is available\n", name.c_str());
} }
}
std::string opt("override_"); std::string opt("override_");
opt += name; opt += name;
@ -332,6 +336,7 @@ namespace GLLoader {
while (s[v] != '\0' && s[v-1] != ' ') v++; while (s[v] != '\0' && s[v-1] != ' ') v++;
const char* vendor = (const char*)glGetString(GL_VENDOR); const char* vendor = (const char*)glGetString(GL_VENDOR);
if (s_first_load)
fprintf(stdout, "OpenGL information. GPU: %s. Vendor: %s. Driver: %s\n", glGetString(GL_RENDERER), vendor, &s[v]); fprintf(stdout, "OpenGL information. GPU: %s. Vendor: %s. Driver: %s\n", glGetString(GL_RENDERER), vendor, &s[v]);
// Name changed but driver is still bad! // Name changed but driver is still bad!
@ -461,8 +466,20 @@ namespace GLLoader {
} }
#endif #endif
if (s_first_load)
fprintf(stdout, "\n"); fprintf(stdout, "\n");
return status; return status;
} }
void check_gl_requirements()
{
if (!GLLoader::check_gl_version(3, 3))
throw GSDXRecoverableError();
if (!GLLoader::check_gl_supported_extension())
throw GSDXRecoverableError();
s_first_load = false;
}
} }

View File

@ -356,9 +356,7 @@ extern PFNGLGENERATEMIPMAPPROC glGenerateMipmap;
namespace GLLoader { namespace GLLoader {
bool check_gl_version(int major, int minor); void check_gl_requirements();
void init_gl_function();
bool check_gl_supported_extension();
extern bool fglrx_buggy_driver; extern bool fglrx_buggy_driver;
extern bool legacy_fglrx_buggy_driver; extern bool legacy_fglrx_buggy_driver;

View File

@ -181,9 +181,5 @@ void GSWndGL::PopulateGlFunction()
// Check openGL requirement as soon as possible so we can switch to another // Check openGL requirement as soon as possible so we can switch to another
// renderer/device // renderer/device
if (!GLLoader::check_gl_version(3, 3)) GLLoader::check_gl_requirements();
throw GSDXRecoverableError();
if (!GLLoader::check_gl_supported_extension())
throw GSDXRecoverableError();
} }