diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-10-03 09:50:19 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-10-03 12:07:11 +0200 |
commit | 1a801e0eefc7064dbb8138e8b97e60e102fffb4a (patch) | |
tree | 99e8e21601f1b311dcdf7fd91ef15a3b21d83107 /src/gui/opengl/qopenglframebufferobject.cpp | |
parent | 54814bbd8f0af5f5b83de46b75b80959c5805546 (diff) | |
download | qtbase-1a801e0eefc7064dbb8138e8b97e60e102fffb4a.tar.gz |
Pass a sized format when creating multisampled renderbuffers on ES
Task-number: QTBUG-40921
Change-Id: I96b05442dd5928992dab06553b3d41feca89084d
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/gui/opengl/qopenglframebufferobject.cpp')
-rw-r--r-- | src/gui/opengl/qopenglframebufferobject.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index f33d4df280..b185e332e6 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -452,13 +452,7 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi if (!funcs.hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample) || !funcs.hasOpenGLExtension(QOpenGLExtensions::FramebufferBlit)) { samples = 0; - } - - // On GLES 2.0 multisampled framebuffers are available through vendor-specific extensions - const bool msaaES2 = ctx->isOpenGLES() && (ctx->hasExtension("GL_ANGLE_framebuffer_multisample") - || ctx->hasExtension("GL_NV_framebuffer_multisample")); - - if (!ctx->isOpenGLES() || msaaES2) { + } else if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) { GLint maxSamples; funcs.glGetIntegerv(GL_MAX_SAMPLES, &maxSamples); samples = qBound(0, int(samples), int(maxSamples)); @@ -483,11 +477,15 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi initTexture(texture_target, internal_format, size, mipmap); } else { GLenum storageFormat = internal_format; + // ES requires a sized format. The older desktop extension does not. Correct the format on ES. + if (ctx->isOpenGLES() && internal_format == GL_RGBA) { #ifdef GL_RGBA8_OES - // Correct the internal format used by the render buffer when using ES with extensions - if (msaaES2 && internal_format == GL_RGBA) - storageFormat = GL_RGBA8_OES; + if (funcs.hasOpenGLExtension(QOpenGLExtensions::Sized8Formats)) + storageFormat = GL_RGBA8_OES; + else #endif + storageFormat = GL_RGBA4; + } mipmap = false; funcs.glGenRenderbuffers(1, &color_buffer); |