summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2010-08-03 01:23:37 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2010-08-03 01:23:37 (GMT)
commitbf5c25c4e7571475255e1d9de307913bee228d10 (patch)
tree8f67cc323eb3a8a5f1fea723783e8efda35686c5 /src/opengl
parent88917087b64a014a69d12946a162ab6588e733e6 (diff)
downloadQt-bf5c25c4e7571475255e1d9de307913bee228d10.zip
Qt-bf5c25c4e7571475255e1d9de307913bee228d10.tar.gz
Qt-bf5c25c4e7571475255e1d9de307913bee228d10.tar.bz2
Don't resolve GLSL extensions if no shaders
If the GL server is 1.x, but the client is 2.x, then the qt_resolve_glsl_extensions() function was returning true because the functions existed client-side, when it should have returned false because the functionality didn't exist server-side. Task-number: QTBUG-12478 Reviewed-by: Sarah Smith
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qglextensions.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/opengl/qglextensions.cpp b/src/opengl/qglextensions.cpp
index c091191..433ccae 100644
--- a/src/opengl/qglextensions.cpp
+++ b/src/opengl/qglextensions.cpp
@@ -233,6 +233,10 @@ bool qt_resolve_glsl_extensions(QGLContext *ctx)
if (glCreateShader)
return true;
+ // Must at least have the FragmentShader extension to continue.
+ if (!(QGLExtensions::glExtensions() & QGLExtensions::FragmentShader))
+ return false;
+
glCreateShader = (_glCreateShader) ctx->getProcAddress(QLatin1String("glCreateShader"));
if (glCreateShader) {
glShaderSource = (_glShaderSource) ctx->getProcAddress(QLatin1String("glShaderSource"));