QOpenGLFramebufferObject: pass sized format also with dynamic GL
authorAndrew Knight <andrew.knight@digia.com>
Wed, 26 Nov 2014 09:13:16 +0000 (11:13 +0200)
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>
Mon, 1 Dec 2014 19:04:11 +0000 (20:04 +0100)
The GL_RGBA8_OES define is not in scope for dynamic OpenGL builds, so
pass in GL_RGBA8 instead (it is defined as the same value, 0x8058) when
in ES mode. The functionality check already ensures the extension is
available, so the ifdef guards can be removed.

This fixes default multisampled FBO creation under ANGLE when using
-opengl dynamic.

Task-number: QTBUG-40921
Change-Id: Iac4b7e230a463c27b61af75c3307421f9deac856
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
src/gui/opengl/qopenglframebufferobject.cpp

index b185e332e6802e32d0d36674f4eddbb6af4053f2..cbc992b7e8ecf7d4d77bb39a294f36497925c32c 100644 (file)
@@ -479,11 +479,9 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi
         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
             if (funcs.hasOpenGLExtension(QOpenGLExtensions::Sized8Formats))
-                storageFormat = GL_RGBA8_OES;
+                storageFormat = GL_RGBA8;
             else
-#endif
                 storageFormat = GL_RGBA4;
         }