diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2019-10-28 09:56:12 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2019-10-28 18:33:38 +0100 |
commit | 1597b809a90138afc81fabbe96ffe2be98abc9de (patch) | |
tree | 87d12f157a2702387b04f5b0d6e533365331978f /src/render/renderers | |
parent | c760aac29f7215605753a71c1f8cb3dc2c7d5494 (diff) |
GLTexture: fix shared texture id handling
Returning early should only be done when not dealing with a shared texture id
as all shared texture id will satisfy the early return condition initially.
This must be the result of a bad manual merge.
Change-Id: I475a608a942a8c178b10c2a49564aee3f464c379
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/render/renderers')
-rw-r--r-- | src/render/renderers/opengl/textures/gltexture.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/render/renderers/opengl/textures/gltexture.cpp b/src/render/renderers/opengl/textures/gltexture.cpp index 1b5a972ec..e0a379138 100644 --- a/src/render/renderers/opengl/textures/gltexture.cpp +++ b/src/render/renderers/opengl/textures/gltexture.cpp @@ -236,7 +236,6 @@ GLTexture::TextureUpdateInfo GLTexture::createOrUpdateGLTexture() m_wasTextureRecreated = false; const bool hasSharedTextureId = m_sharedTextureId > 0; - // Only load texture data if we are not using a sharedTextureId // Check if dataFunctor or images have changed if (!hasSharedTextureId) { @@ -269,17 +268,17 @@ GLTexture::TextureUpdateInfo GLTexture::createOrUpdateGLTexture() // Reset image flag setDirtyFlag(TextureImageData, false); } - } - // Don't try to create the texture if the target or format was still not set - // Format should either be set by user or if Automatic - // by either the dataGenerator of the texture or the first Image - // Target should explicitly be set by the user or the dataGenerator - if (m_properties.target == QAbstractTexture::TargetAutomatic || - m_properties.format == QAbstractTexture::Automatic || - m_properties.format == QAbstractTexture::NoFormat) { - textureInfo.properties.status = QAbstractTexture::Error; - return textureInfo; + // Don't try to create the texture if the target or format was still not set + // Format should either be set by user or if Automatic + // by either the dataGenerator of the texture or the first Image + // Target should explicitly be set by the user or the dataGenerator + if (m_properties.target == QAbstractTexture::TargetAutomatic || + m_properties.format == QAbstractTexture::Automatic || + m_properties.format == QAbstractTexture::NoFormat) { + textureInfo.properties.status = QAbstractTexture::Error; + return textureInfo; + } } // If the properties changed or texture has become a shared texture from a |