summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-06-22 11:42:08 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-06-22 21:15:37 +0000
commit706af26acc5deeeab17ac135daa23876a69c78dc (patch)
tree25dad573d5930ab7c88218b9f6f17fb4a47459fc
parent8aaf8d33e1a22778b8a0d6063cee1a7915326838 (diff)
Do not claim TextureRGFormats on Mesa with GLES
Mesa provides GL ES 3.0 so using GL_RED in place of GL_ALPHA should work. This is apparently not the case. Task-number: QTBUG-46605 Change-Id: I4f661487b47e9cc11f5de110196ec37150c99c7f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index 88dd897820..8ddb693e73 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -289,8 +289,12 @@ static int qt_gl_resolve_features()
if (extensions.match("GL_OES_texture_npot"))
features |= QOpenGLFunctions::NPOTTextures |
QOpenGLFunctions::NPOTTextureRepeat;
- if (ctx->format().majorVersion() >= 3 || extensions.match("GL_EXT_texture_rg"))
- features |= QOpenGLFunctions::TextureRGFormats;
+ if (ctx->format().majorVersion() >= 3 || extensions.match("GL_EXT_texture_rg")) {
+ // Mesa's GLES implementation (as of 10.6.0) is unable to handle this, even though it provides 3.0.
+ const char *renderer = reinterpret_cast<const char *>(ctx->functions()->glGetString(GL_RENDERER));
+ if (!(renderer && strstr(renderer, "Mesa")))
+ features |= QOpenGLFunctions::TextureRGFormats;
+ }
return features;
} else {
// OpenGL