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>
This commit is contained in:
Laszlo Agocs 2015-06-22 11:42:08 +02:00
parent 8aaf8d33e1
commit 706af26acc

View File

@ -289,8 +289,12 @@ static int qt_gl_resolve_features()
if (extensions.match("GL_OES_texture_npot")) if (extensions.match("GL_OES_texture_npot"))
features |= QOpenGLFunctions::NPOTTextures | features |= QOpenGLFunctions::NPOTTextures |
QOpenGLFunctions::NPOTTextureRepeat; QOpenGLFunctions::NPOTTextureRepeat;
if (ctx->format().majorVersion() >= 3 || extensions.match("GL_EXT_texture_rg")) 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; features |= QOpenGLFunctions::TextureRGFormats;
}
return features; return features;
} else { } else {
// OpenGL // OpenGL