summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-12-07 00:07:13 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-12-07 00:07:13 (GMT)
commit8fea31ca0ab98ef6fed7bb2d87d97f4f425b2078 (patch)
treec04d64f83b97d31daf1a0dbbb5b1ca02663d79a9 /src/opengl/qgl.cpp
parent8f27913d0558c96a781b81834396374318b70fd6 (diff)
downloadQt-8fea31ca0ab98ef6fed7bb2d87d97f4f425b2078.zip
Qt-8fea31ca0ab98ef6fed7bb2d87d97f4f425b2078.tar.gz
Qt-8fea31ca0ab98ef6fed7bb2d87d97f4f425b2078.tar.bz2
Detect GL2 paint engine based on fragment shaders, not programs
The auto-detect logic was looking for fragment programs to check for OpenGL2 support. It should have been looking for fragment shaders. Task-number: QTBUG-5638 Reviewed-by: Sarah Smith
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r--src/opengl/qgl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index b376901..1ff102f 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -173,12 +173,12 @@ public:
#else
// We can't do this in the constructor for this object because it
// needs to be called *before* the QApplication constructor.
- // Also check for the FragmentProgram extension in conjunction with
+ // Also check for the FragmentShader extension in conjunction with
// the 2.0 version flag, to cover the case where we export the display
// from an old GL 1.1 server to a GL 2.x client. In that case we can't
// use GL 2.0.
if ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0)
- && (QGLExtensions::glExtensions & QGLExtensions::FragmentProgram)
+ && (QGLExtensions::glExtensions & QGLExtensions::FragmentShader)
&& qgetenv("QT_GL_USE_OPENGL1ENGINE").isEmpty())
engineType = QPaintEngine::OpenGL2;
else
@@ -4832,6 +4832,8 @@ void QGLExtensions::init_extensions()
glExtensions |= PVRTCTextureCompression;
if (extensions.contains("GL_ARB_fragment_program"))
glExtensions |= FragmentProgram;
+ if (extensions.contains("GL_ARB_fragment_shader"))
+ glExtensions |= FragmentShader;
if (extensions.contains("GL_ARB_texture_mirrored_repeat"))
glExtensions |= MirroredRepeat;
if (extensions.contains("GL_EXT_framebuffer_object"))
@@ -4849,6 +4851,7 @@ void QGLExtensions::init_extensions()
#if defined(QT_OPENGL_ES_2)
glExtensions |= FramebufferObject;
glExtensions |= GenerateMipmap;
+ glExtensions |= FragmentShader;
#endif
#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL)
if (extensions.contains("GL_OES_framebuffer_object"))