summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@qt.io>2018-04-12 15:46:34 +0200
committerAndy Nichols <andy.nichols@qt.io>2018-04-12 15:03:38 +0000
commit6d73c51d44d10925a05804cd8e70978f155643df (patch)
tree840bb96d43f0a53aa24e1348f305d45569dd521e
parente4846ce77490d3e6b33b33de1e4775cfcf5aed6f (diff)
ES2: Do not set Mip Levels on GL Textures when its not supportedv5.11.0-beta4
By checking the for the TextureMipMapLevel feature we can avoid loads of qWarning messages when running on ES2. In practice these calls were just ignored QOpenGLTexture, but this will prevent the warnings. Change-Id: Ie61ce9ac546b48395b247e78f8fbbbed82399ede Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/render/renderers/opengl/textures/gltexture.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/render/renderers/opengl/textures/gltexture.cpp b/src/render/renderers/opengl/textures/gltexture.cpp
index e94122f67..c98e95759 100644
--- a/src/render/renderers/opengl/textures/gltexture.cpp
+++ b/src/render/renderers/opengl/textures/gltexture.cpp
@@ -381,8 +381,10 @@ QOpenGLTexture *GLTexture::buildGLTexture()
glTex->setMipLevels(glTex->maximumMipLevels());
} else {
glTex->setAutoMipMapGenerationEnabled(false);
- glTex->setMipBaseLevel(0);
- glTex->setMipMaxLevel(m_properties.mipLevels - 1);
+ if (glTex->hasFeature(QOpenGLTexture::TextureMipMapLevel)) {
+ glTex->setMipBaseLevel(0);
+ glTex->setMipMaxLevel(m_properties.mipLevels - 1);
+ }
glTex->setMipLevels(m_properties.mipLevels);
}