summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglframebufferobject.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2014-06-07 00:40:44 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-07 00:40:44 +0200
commitd9a7ad80f78e7346d6f4dbae2cabe31305d6458f (patch)
tree26a410780b94c553051b8898d5abaf37a909691b /src/gui/opengl/qopenglframebufferobject.cpp
parentd707acfc9e357ffc86feb5d9219372c30c5ff157 (diff)
parent0fcce50af009f97efa2a5c5f2c74415c92830962 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/gui/opengl/qopenglframebufferobject.cpp')
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index af0abb5ea7..231e475111 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -453,10 +453,19 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi
if (samples == 0) {
initTexture(texture_target, internal_format, size, mipmap);
} else {
+ GLenum storageFormat = internal_format;
+#ifdef GL_RGBA8_OES
+ // Correct the internal format used by the render buffer when using ANGLE
+ if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES && internal_format == GL_RGBA
+ && strstr((const char *)funcs.glGetString(GL_RENDERER), "ANGLE") != 0) {
+ storageFormat = GL_RGBA8_OES;
+ }
+#endif
+
mipmap = false;
funcs.glGenRenderbuffers(1, &color_buffer);
funcs.glBindRenderbuffer(GL_RENDERBUFFER, color_buffer);
- funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, internal_format, size.width(), size.height());
+ funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, storageFormat, size.width(), size.height());
funcs.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER, color_buffer);
QT_CHECK_GLERROR();