summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-08-30 14:11:03 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-08-30 14:11:03 (GMT)
commit1ba3cac3c7296320ca914f262f124ae7f2dea841 (patch)
tree40e9c04835dcfe8adccb4cedfda5e568f3c92677 /src/opengl
parent708978d1c18cf938a4e0c29a5a90be5de4e82140 (diff)
parent51582e3d1251766a3ed941530d966e1a591cbed6 (diff)
downloadQt-1ba3cac3c7296320ca914f262f124ae7f2dea841.zip
Qt-1ba3cac3c7296320ca914f262f124ae7f2dea841.tar.gz
Qt-1ba3cac3c7296320ca914f262f124ae7f2dea841.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: qmake/generators/win32/msbuild_objectmodel.cpp qmake/generators/win32/msvc_vcxproj.cpp tests/auto/qnetworkreply/tst_qnetworkreply.cpp
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl.cpp3
-rw-r--r--src/opengl/qgl_p.h3
-rw-r--r--src/opengl/qgl_win.cpp2
-rw-r--r--src/opengl/qglshaderprogram.cpp10
4 files changed, 14 insertions, 4 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 532c724..f6ea6be 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -5246,6 +5246,8 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions()
glExtensions |= FragmentProgram;
if (extensions.match("GL_ARB_fragment_shader"))
glExtensions |= FragmentShader;
+ if (extensions.match("GL_ARB_ES2_compatibility"))
+ glExtensions |= ES2Compatibility;
if (extensions.match("GL_ARB_texture_mirrored_repeat"))
glExtensions |= MirroredRepeat;
if (extensions.match("GL_EXT_framebuffer_object"))
@@ -5266,6 +5268,7 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions()
glExtensions |= FramebufferObject;
glExtensions |= GenerateMipmap;
glExtensions |= FragmentShader;
+ glExtensions |= ES2Compatibility;
#endif
#if defined(QT_OPENGL_ES_1)
if (extensions.match("GL_OES_framebuffer_object"))
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index f86a848..78f888a 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -282,7 +282,8 @@ public:
DDSTextureCompression = 0x00008000,
ETC1TextureCompression = 0x00010000,
PVRTCTextureCompression = 0x00020000,
- FragmentShader = 0x00040000
+ FragmentShader = 0x00040000,
+ ES2Compatibility = 0x00080000
};
Q_DECLARE_FLAGS(Extensions, Extension)
diff --git a/src/opengl/qgl_win.cpp b/src/opengl/qgl_win.cpp
index 3f13ac4..5f7d4e2 100644
--- a/src/opengl/qgl_win.cpp
+++ b/src/opengl/qgl_win.cpp
@@ -1042,7 +1042,7 @@ int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc)
iAttributes[i++] = WGL_DRAW_TO_WINDOW_ARB;
iAttributes[i++] = TRUE;
iAttributes[i++] = WGL_COLOR_BITS_ARB;
- iAttributes[i++] = 32;
+ iAttributes[i++] = 24;
iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB;
iAttributes[i++] = d->glFormat.doubleBuffer();
if (d->glFormat.stereo()) {
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index 74382b0..bc1c009 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -97,6 +97,10 @@ QT_BEGIN_NAMESPACE
to just features that are present in GLSL/ES, and avoid
standard variable names that only work on the desktop.
+ If the \c{GL_ARB_ES2_compatibility} extension is present,
+ then the above prefix is not added because the desktop OpenGL
+ implementation supports precision qualifiers.
+
\section1 Simple shader example
\snippet doc/src/snippets/code/src_opengl_qglshaderprogram.cpp 1
@@ -394,8 +398,10 @@ bool QGLShader::compileSourceCode(const char *source)
srclen.append(GLint(headerLen));
}
#ifdef QGL_DEFINE_QUALIFIERS
- src.append(qualifierDefines);
- srclen.append(GLint(sizeof(qualifierDefines) - 1));
+ if (!(QGLExtensions::glExtensions() & QGLExtensions::ES2Compatibility)) {
+ src.append(qualifierDefines);
+ srclen.append(GLint(sizeof(qualifierDefines) - 1));
+ }
#endif
#ifdef QGL_REDEFINE_HIGHP
if (d->shaderType == Fragment) {