summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2018-09-21 15:33:34 +0200
committerPaul Lemire <paul.lemire@kdab.com>2018-09-24 11:53:58 +0000
commite22971073ee10ee891c61a94f934b0b3403cc5a7 (patch)
tree89958f967c0f5f159e5a38553ffbfd1e914eb3de
parentb830f4307559007ff1b9c91bed6a881a6f6efdfb (diff)
GLTexture: mark texture for upload when it's recreated and contains data
In some cases, a GLTexture will destroy its internal OpenGL texture before recreating it (when it requires a new allocation due to some property change). When this happens, we need to ensure we also request our content data to be uploaded after the new internal OpenGL texture is recreated. Change-Id: Ifd3f8a1e40e5fad63d117417006c65fade5c2b39 Task-number: QTBUG-70551 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/render/renderers/opengl/textures/gltexture.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/render/renderers/opengl/textures/gltexture.cpp b/src/render/renderers/opengl/textures/gltexture.cpp
index b61d06a80..e98f3965d 100644
--- a/src/render/renderers/opengl/textures/gltexture.cpp
+++ b/src/render/renderers/opengl/textures/gltexture.cpp
@@ -212,6 +212,10 @@ GLTexture::TextureUpdateInfo GLTexture::createOrUpdateGLTexture()
delete m_gl;
m_gl = nullptr;
textureInfo.wasUpdated = true;
+ // If we are destroyed because of some property change but still our content data
+ // make sure we are marked for upload
+ if (m_textureData || !m_imageData.empty())
+ needUpload = true;
}