summaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/opengl/qgl.cpp7
-rw-r--r--src/opengl/qgl_p.h3
2 files changed, 7 insertions, 3 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"))
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 0f785a5..179d69a 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -383,7 +383,8 @@ public:
BGRATextureFormat = 0x00004000,
DDSTextureCompression = 0x00008000,
ETC1TextureCompression = 0x00010000,
- PVRTCTextureCompression = 0x00020000
+ PVRTCTextureCompression = 0x00020000,
+ FragmentShader = 0x00040000
};
Q_DECLARE_FLAGS(Extensions, Extension)