Merge pull request #4129 from RisingFog/hahahahahahahahahaha

Fix a really stupid GLSL version parsing bug
This commit is contained in:
Scott Mansell 2016-08-20 08:48:28 +12:00 committed by GitHub
commit f1964f90d6
2 changed files with 8 additions and 11 deletions

View File

@ -352,7 +352,6 @@ Renderer::Renderer()
g_ogl_config.gl_vendor = (const char*)glGetString(GL_VENDOR);
g_ogl_config.gl_renderer = (const char*)glGetString(GL_RENDERER);
g_ogl_config.gl_version = (const char*)glGetString(GL_VERSION);
g_ogl_config.glsl_version = (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION);
InitDriverInfo();
@ -527,13 +526,13 @@ Renderer::Renderer()
// depth clamping.
g_Config.backend_info.bSupportsDepthClamp = false;
if (strstr(g_ogl_config.glsl_version, "3.0"))
if (GLExtensions::Version() == 300)
{
g_ogl_config.eSupportedGLSLVersion = GLSLES_300;
g_ogl_config.bSupportsAEP = false;
g_Config.backend_info.bSupportsGeometryShaders = false;
}
else if (strstr(g_ogl_config.glsl_version, "3.1"))
else if (GLExtensions::Version() == 310)
{
g_ogl_config.eSupportedGLSLVersion = GLSLES_310;
g_ogl_config.bSupportsAEP = GLExtensions::Supports("GL_ANDROID_extension_pack_es31a");
@ -575,16 +574,15 @@ Renderer::Renderer()
}
else
{
if (strstr(g_ogl_config.glsl_version, "1.00") || strstr(g_ogl_config.glsl_version, "1.10") ||
strstr(g_ogl_config.glsl_version, "1.20"))
if (GLExtensions::Version() < 300)
{
PanicAlert("GPU: OGL ERROR: Need at least GLSL 1.30\n"
"GPU: Does your video card support OpenGL 3.0?\n"
"GPU: Your driver supports GLSL %s",
g_ogl_config.glsl_version);
(const char*)glGetString(GL_SHADING_LANGUAGE_VERSION));
bSuccess = false;
}
else if (strstr(g_ogl_config.glsl_version, "1.30"))
else if (GLExtensions::Version() == 300)
{
g_ogl_config.eSupportedGLSLVersion = GLSL_130;
g_ogl_config.bSupportsEarlyFragmentTests =
@ -594,7 +592,7 @@ Renderer::Renderer()
g_Config.backend_info.bSupportsGeometryShaders =
false; // geometry shaders are only supported on glsl150+
}
else if (strstr(g_ogl_config.glsl_version, "1.40"))
else if (GLExtensions::Version() == 310)
{
g_ogl_config.eSupportedGLSLVersion = GLSL_140;
g_ogl_config.bSupportsEarlyFragmentTests =
@ -604,11 +602,11 @@ Renderer::Renderer()
g_Config.backend_info.bSupportsGeometryShaders =
false; // geometry shaders are only supported on glsl150+
}
else if (strstr(g_ogl_config.glsl_version, "1.50"))
else if (GLExtensions::Version() == 320)
{
g_ogl_config.eSupportedGLSLVersion = GLSL_150;
}
else if (strstr(g_ogl_config.glsl_version, "3.30"))
else if (GLExtensions::Version() == 330)
{
g_ogl_config.eSupportedGLSLVersion = GLSL_330;
}

View File

@ -55,7 +55,6 @@ struct VideoConfig
const char* gl_vendor;
const char* gl_renderer;
const char* gl_version;
const char* glsl_version;
s32 max_samples;
};