From a7fa2618e4c8f10927a01d415d96ee783cf4348d Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 14 Jan 2019 13:00:06 -0600 Subject: Update QOpenGLTexture::generateMipMaps for ES 3 Per the Khronos documentation, this operation is not permitted on ES 3. Change-Id: Iff70ef83d48228277b883df588011432ba80f4bd Reviewed-by: Giuseppe D'Angelo --- src/gui/opengl/qopengltexture.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp index cea4b51a5c..5b7956d31e 100644 --- a/src/gui/opengl/qopengltexture.cpp +++ b/src/gui/opengl/qopengltexture.cpp @@ -3914,8 +3914,7 @@ bool QOpenGLTexture::isAutoMipMapGenerationEnabled() const have disabled automatic mipmap generation then you need to call this function or the overload to create the mipmap chain. - \note Mipmap generation is not supported for compressed textures with OpenGL - ES 2.0. + \note Mipmap generation is not supported for compressed textures with OpenGL ES. \sa setAutoMipMapGenerationEnabled(), setMipLevels(), mipLevels() */ @@ -3926,7 +3925,7 @@ void QOpenGLTexture::generateMipMaps() Q_ASSERT(d->textureId); if (isCompressedFormat(d->format)) { if (QOpenGLContext *ctx = QOpenGLContext::currentContext()) - if (ctx->isOpenGLES() && ctx->format().majorVersion() < 3) + if (ctx->isOpenGLES()) return; } d->texFuncs->glGenerateTextureMipmap(d->textureId, d->target, d->bindingTarget); @@ -3951,7 +3950,7 @@ void QOpenGLTexture::generateMipMaps(int baseLevel, bool resetBaseLevel) Q_ASSERT(d->textureId); if (isCompressedFormat(d->format)) { if (QOpenGLContext *ctx = QOpenGLContext::currentContext()) - if (ctx->isOpenGLES() && ctx->format().majorVersion() < 3) + if (ctx->isOpenGLES()) return; } int oldBaseLevel; -- cgit v1.2.3