From: Ian Romanick Date: Tue, 24 Nov 2009 02:32:27 +0000 (-0800) Subject: shaderutil: Fix detection of shaders X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=da0883114b1dceceff8a38deea1bb870fda40464;p=mesa.git shaderutil: Fix detection of shaders Check for versions >= 2.0 (because some drivers return 3.0), and return GL_FALSE if shaders are not detected. --- diff --git a/progs/util/shaderutil.c b/progs/util/shaderutil.c index 4db950016b8..629b6f1d972 100644 --- a/progs/util/shaderutil.c +++ b/progs/util/shaderutil.c @@ -25,7 +25,11 @@ GLboolean ShadersSupported(void) { const char *version = (const char *) glGetString(GL_VERSION); - if (version[0] == '2' && version[1] == '.') { + + /* NVIDIA binary drivers will return "3.0.0", and they clearly support + * shaders. + */ + if (version[0] >= '2' && version[1] == '.') { return GL_TRUE; } else if (glutExtensionSupported("GL_ARB_vertex_shader") @@ -34,7 +38,7 @@ ShadersSupported(void) fprintf(stderr, "Warning: Trying ARB GLSL instead of OpenGL 2.x. This may not work.\n"); return GL_TRUE; } - return GL_TRUE; + return GL_FALSE; }