aboutsummaryrefslogtreecommitdiff
path: root/mesalib/progs/util/shaderutil.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-03-07 16:00:29 +0000
committermarha <marha@users.sourceforge.net>2010-03-07 16:00:29 +0000
commitb40894093babb10f3cd155f11ff2d6c710372395 (patch)
treee6e94e5aa39ca9d5a653af567145e4b5dda25d61 /mesalib/progs/util/shaderutil.c
parentd27419efcdaaccb40e0f10c549a6b732a2f29e81 (diff)
parent14b1cb8d5a27ec9716d3f790fce95f0469e35605 (diff)
downloadvcxsrv-b40894093babb10f3cd155f11ff2d6c710372395.tar.gz
vcxsrv-b40894093babb10f3cd155f11ff2d6c710372395.tar.bz2
vcxsrv-b40894093babb10f3cd155f11ff2d6c710372395.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/progs/util/shaderutil.c')
-rw-r--r--mesalib/progs/util/shaderutil.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/mesalib/progs/util/shaderutil.c b/mesalib/progs/util/shaderutil.c
index 4db950016..2f44c388d 100644
--- a/mesalib/progs/util/shaderutil.c
+++ b/mesalib/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,8 @@ ShadersSupported(void)
fprintf(stderr, "Warning: Trying ARB GLSL instead of OpenGL 2.x. This may not work.\n");
return GL_TRUE;
}
- return GL_TRUE;
+ fprintf(stderr, "Sorry, GLSL not supported with this OpenGL.\n");
+ return GL_FALSE;
}
@@ -84,6 +89,7 @@ CompileShaderFile(GLenum shaderType, const char *filename)
f = fopen(filename, "r");
if (!f) {
fprintf(stderr, "Unable to open shader file %s\n", filename);
+ free(buffer);
return 0;
}
@@ -94,6 +100,8 @@ CompileShaderFile(GLenum shaderType, const char *filename)
shader = CompileShaderText(shaderType, buffer);
}
else {
+ fclose(f);
+ free(buffer);
return 0;
}