summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglshaderprogram.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2010-02-08 12:03:34 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2010-02-08 12:03:55 (GMT)
commite98c07e5247a5ad4876c4add595ec1897b73b190 (patch)
tree54ad771342eafa165e72655efe9de6aa22e5ddf7 /src/opengl/qglshaderprogram.cpp
parent760319b312aceb2cc7438ad09eecd305c1b663e8 (diff)
downloadQt-e98c07e5247a5ad4876c4add595ec1897b73b190.zip
Qt-e98c07e5247a5ad4876c4add595ec1897b73b190.tar.gz
Qt-e98c07e5247a5ad4876c4add595ec1897b73b190.tar.bz2
Another round of Geometry shader review.
Reviewed-by: Trond
Diffstat (limited to 'src/opengl/qglshaderprogram.cpp')
-rw-r--r--src/opengl/qglshaderprogram.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index 7af488d..22db731 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -558,17 +558,6 @@ bool QGLShaderProgramPrivate::hasShader(QGLShader::ShaderType type) const
#define ctx d->programGuard.context()
/*!
- \enum GeometryTypes
-
- Defines the geometry types specificed by the GL_EXT_geometry_shader4 extension
-
- \value LinesWithAdjacencyGeometryType Corresponds to GL_LINES_ADJACENCY.
- \value LineStripWithAdjacencyGeometryType Corresponds to GL_LINE_STRIP_ADJACENCY.
- \value TrianglesWithAdjacencyGeometryType Corresponds to GL_TRIANGLES_ADJACENCY.
- \value TriangleStripWithAdjacencyGeometryType Corresponds to GL_TRIANGLE_STRIP_ADJACENCY.
- */
-
-/*!
Constructs a new shader program and attaches it to \a parent.
The program will be invalid until addShader() is called.
@@ -612,6 +601,7 @@ bool QGLShaderProgram::init()
context = QGLContext::currentContext();
d->programGuard.setContext(context);
}
+
if (!context)
return false;
if (qt_resolve_glsl_extensions(const_cast<QGLContext *>(context))) {
@@ -3002,12 +2992,14 @@ void QGLShaderProgram::shaderDestroyed()
*/
bool QGLShader::hasOpenGLShaders(ShaderType type, const QGLContext *context)
{
-#if !defined(QT_OPENGL_ES_2)
if (!context)
context = QGLContext::currentContext();
if (!context)
return false;
-#endif
+
+ if ((type & ~(Geometry | Vertex | Fragment)) || type == 0)
+ return false;
+
bool resolved = qt_resolve_glsl_extensions(const_cast<QGLContext *>(context));
if (!resolved)
return false;