From 7715ce9fab3b5f46f1d7e0a1503323200790d9c6 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 19 Mar 2015 17:21:00 +0100 Subject: [PATCH] Disable usage of glTexStorage on Mali ES 3.0 Even though immutable storage is available and the glTexStorage2D seems to succeed, the subsequent glTexSubImage2D calls always fail with GL_INVALID_OPERATION. Falling back to mutable storage works just fine. This makes QOpenGLTexture and examples like qtbase's textures functional on Mali T628 (tested with Odroid XU-3). Task-number: QTBUG-45106 Change-Id: If1b4fe6673ba924cfa7cfd7af7d4f0bc3b6a0fe8 Reviewed-by: Giuseppe D'Angelo --- src/gui/opengl/qopengltexture.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp index f480a2a109b..fa4b6cdab08 100644 --- a/src/gui/opengl/qopengltexture.cpp +++ b/src/gui/opengl/qopengltexture.cpp @@ -3278,10 +3278,11 @@ bool QOpenGLTexture::hasFeature(Feature feature) if (ctx->isOpenGLES()) #endif { + const char *renderer = reinterpret_cast(ctx->functions()->glGetString(GL_RENDERER)); switch (feature) { case ImmutableStorage: - supported = f.version() >= qMakePair(3, 0) - || ctx->hasExtension(QByteArrayLiteral("EXT_texture_storage")); + supported = (f.version() >= qMakePair(3, 0) || ctx->hasExtension(QByteArrayLiteral("EXT_texture_storage"))) + && !(renderer && strstr(renderer, "Mali")); // do not use on Mali: QTBUG-45106 break; case ImmutableMultisampleStorage: