summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglextensions.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2010-04-16 04:42:09 (GMT)
committerGunnar Sletta <gunnar.sletta@nokia.com>2010-04-19 08:28:39 (GMT)
commitb1d187399b79b980bc49cb9f78320466da54f977 (patch)
tree7591971b9227ffa376383845447035ba71f733a7 /src/opengl/qglextensions.cpp
parent4676dd62871da2b58452ebda477a04c25158bec4 (diff)
downloadQt-b1d187399b79b980bc49cb9f78320466da54f977.zip
Qt-b1d187399b79b980bc49cb9f78320466da54f977.tar.gz
Qt-b1d187399b79b980bc49cb9f78320466da54f977.tar.bz2
Don't resolve geometry shaders every time...
This was a huge extra cost in all QPainter::begin's on GL target surfaces Reviewed-by: Rhys Weatherley
Diffstat (limited to 'src/opengl/qglextensions.cpp')
-rw-r--r--src/opengl/qglextensions.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/opengl/qglextensions.cpp b/src/opengl/qglextensions.cpp
index ef3c4cd..8e2bbd4 100644
--- a/src/opengl/qglextensions.cpp
+++ b/src/opengl/qglextensions.cpp
@@ -235,11 +235,6 @@ bool qt_resolve_eglimage_gl_extensions(QGLContext *ctx)
bool qt_resolve_glsl_extensions(QGLContext *ctx)
{
- // Geometry shaders are optional...
- glProgramParameteriEXT = (_glProgramParameteriEXT) ctx->getProcAddress(QLatin1String("glProgramParameteriEXT"));
- glFramebufferTextureEXT = (_glFramebufferTextureEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureEXT"));
- glFramebufferTextureLayerEXT = (_glFramebufferTextureLayerEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureLayerEXT"));
- glFramebufferTextureFaceEXT = (_glFramebufferTextureFaceEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureFaceEXT"));
#if defined(QT_OPENGL_ES_2)
// The GLSL shader functions are always present in OpenGL/ES 2.0.
@@ -254,6 +249,12 @@ bool qt_resolve_glsl_extensions(QGLContext *ctx)
if (glCreateShader)
return true;
+ // Geometry shaders are optional...
+ glProgramParameteriEXT = (_glProgramParameteriEXT) ctx->getProcAddress(QLatin1String("glProgramParameteriEXT"));
+ glFramebufferTextureEXT = (_glFramebufferTextureEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureEXT"));
+ glFramebufferTextureLayerEXT = (_glFramebufferTextureLayerEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureLayerEXT"));
+ glFramebufferTextureFaceEXT = (_glFramebufferTextureFaceEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureFaceEXT"));
+
glCreateShader = (_glCreateShader) ctx->getProcAddress(QLatin1String("glCreateShader"));
if (glCreateShader) {
glShaderSource = (_glShaderSource) ctx->getProcAddress(QLatin1String("glShaderSource"));