diff options
author | Svenn-Arne Dragly <s@dragly.com> | 2018-10-30 15:18:56 +0100 |
---|---|---|
committer | Andy Nichols <andy.nichols@qt.io> | 2018-11-09 09:02:27 +0000 |
commit | dfac45c759bbd4a483015bb87eb85501d4918c12 (patch) | |
tree | e504c30736b3a072e2693cad8da89f96ed00e1a2 | |
parent | 10ae9bc43bf7a44ad92b595bb1132ec9767d49b3 (diff) |
Dragon: Derive mipLevels of texture based on texture images
This part got lost in the transition from Qt3DRender.
Change-Id: Ib594b8117c1fa19983cda2ab54636fdce89ffcff
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-rw-r--r-- | src/runtime/dragon/dragongltexture.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/runtime/dragon/dragongltexture.cpp b/src/runtime/dragon/dragongltexture.cpp index 0023569..7abfdc9 100644 --- a/src/runtime/dragon/dragongltexture.cpp +++ b/src/runtime/dragon/dragongltexture.cpp @@ -92,6 +92,7 @@ TextureProperties deriveProperties(const Immutable<LoadedTexture> &loadedTexture // TODO should this be an else if? Why would we set differing sizes on images and generator? if (loadedTexture->images.size() > 0) { const auto &images = loadedTexture->images; + int mipLevels = 1; for (const auto &loadedImage : images) { const auto &image = loadedImage->image; const auto imageData = loadedImage->data; @@ -115,7 +116,9 @@ TextureProperties deriveProperties(const Immutable<LoadedTexture> &loadedTexture imageData->format()); } } + mipLevels = qMax(mipLevels, image->mipLevel); } + properties.mipLevels = mipLevels; } return properties; } @@ -231,7 +234,6 @@ GLTexture createGlTexture(const Immutable<LoadedTexture> &loadedTexture, QOpenGL result.openGLTexture.reset(glTex); if (!needUpload) { - qWarning() << Q_FUNC_INFO << "No need for upload"; return result; } |