diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index a4ed74637c..0e5a1327b0 100644 --- a/src/gui/opengl/qopenglfunctions.cpp +++ b/src/gui/opengl/qopenglfunctions.cpp @@ -347,6 +347,9 @@ static int qt_gl_resolve_extensions() { int extensions = 0; QOpenGLExtensionMatcher extensionMatcher; + if (extensionMatcher.match("GL_EXT_bgra")) + extensions |= QOpenGLExtensions::BGRATextureFormat; + #if defined(QT_OPENGL_ES) if (extensionMatcher.match("GL_OES_mapbuffer")) extensions |= QOpenGLExtensions::MapBuffer; @@ -356,10 +359,9 @@ static int qt_gl_resolve_extensions() extensions |= QOpenGLExtensions::ElementIndexUint; if (extensionMatcher.match("GL_OES_depth24")) extensions |= QOpenGLExtensions::Depth24; - - if (extensionMatcher.match("GL_EXT_bgra")) + // TODO: Consider matching GL_APPLE_texture_format_BGRA8888 as well, but it needs testing. + if (extensionMatcher.match("GL_IMG_texture_format_BGRA8888") || extensionMatcher.match("GL_EXT_texture_format_BGRA8888")) extensions |= QOpenGLExtensions::BGRATextureFormat; - #else QSurfaceFormat format = QOpenGLContext::currentContext()->format(); extensions |= QOpenGLExtensions::ElementIndexUint | QOpenGLExtensions::MapBuffer;