From 1597b809a90138afc81fabbe96ffe2be98abc9de Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Mon, 28 Oct 2019 09:56:12 +0100 Subject: 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 --- src/render/renderers/opengl/textures/gltexture.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/render/renderers/opengl/textures/gltexture.cpp') 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 -- cgit v1.2.3