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 <giuseppe.dangelo@kdab.com>
bb10
Michael Brasser 2019-01-14 13:00:06 -06:00 committed by Michael Brasser
parent eabef55b8b
commit a7fa2618e4
1 changed files with 3 additions and 4 deletions

View File

@ -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;