diff options
author | Eric Anholt <eric@anholt.net> | 2020-04-20 12:58:00 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2020-04-20 13:01:08 -0700 |
commit | 1e0b063dbd8b9f5f0ba950a6b3946f05dff92e97 (patch) | |
tree | 028111c806a8de1d1da05049db51ce93b6baa49e /src | |
parent | 4e26d4dcfa94175183478fe2144b0112048a35cd (diff) | |
download | libepoxy-1e0b063dbd8b9f5f0ba950a6b3946f05dff92e97.tar.gz |
Fix return value of shading language for GLES2.glsles
Throughout the mesa project we've been using 100 for GLES2's shading
language. It was pretty clearly the intent here, but the clever
inline detection of "am I parsing a GLSL version or a GL version
string" forgot about GLSL 1.0.x, and thus returned 10.
Diffstat (limited to 'src')
-rw-r--r-- | src/dispatch_common.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/dispatch_common.c b/src/dispatch_common.c index b3e4f5f..9977a02 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -392,10 +392,10 @@ epoxy_is_desktop_gl(void) } static int -epoxy_internal_gl_version(GLenum version_string, int error_version) +epoxy_internal_gl_version(GLenum version_string, int error_version, int factor) { const char *version = (const char *)glGetString(version_string); - GLint major, minor, factor; + GLint major, minor; int scanf_count; if (!version) @@ -413,11 +413,6 @@ epoxy_internal_gl_version(GLenum version_string, int error_version) abort(); } - if (minor >= 10) - factor = 100; - else - factor = 10; - return factor * major + minor; } @@ -439,7 +434,7 @@ epoxy_internal_gl_version(GLenum version_string, int error_version) int epoxy_gl_version(void) { - return epoxy_internal_gl_version(GL_VERSION, 0); + return epoxy_internal_gl_version(GL_VERSION, 0, 10); } int @@ -448,7 +443,7 @@ epoxy_conservative_gl_version(void) if (api.begin_count) return 100; - return epoxy_internal_gl_version(GL_VERSION, 100); + return epoxy_internal_gl_version(GL_VERSION, 100, 10); } /** @@ -471,7 +466,7 @@ epoxy_glsl_version(void) { if (epoxy_gl_version() >= 20 || epoxy_has_gl_extension ("GL_ARB_shading_language_100")) - return epoxy_internal_gl_version(GL_SHADING_LANGUAGE_VERSION, 0); + return epoxy_internal_gl_version(GL_SHADING_LANGUAGE_VERSION, 0, 100); return 0; } |