diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2018-07-16 10:01:18 +0200 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2018-07-18 07:46:39 +0000 |
commit | 78cc8598d44c1af4cf5964b0b8a935901db82856 (patch) | |
tree | e227c62d7ce22ac65ee29f9ebf8fec25532e4feb /src/render/texture | |
parent | 5376853866e49b5a6841c6c41affef5a3d3d4bb5 (diff) |
Renderer: do not lookup cleanup textures
Since they are already destroyed, cleanup textured ids shouldn't be used to
look up backend textures but only to tell the GLTextureManager to abandon
referenced textures. The was an oversight that should have been handled in
d47c78e6.
Change-Id: Iafaee4bb6442c907f6e011c80b5e5347579efde5
Task-number: QTBUG-69379
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/texture')
-rw-r--r-- | src/render/texture/apitexturemanager_p.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/render/texture/apitexturemanager_p.h b/src/render/texture/apitexturemanager_p.h index 91747b3bc..97dc1eb27 100644 --- a/src/render/texture/apitexturemanager_p.h +++ b/src/render/texture/apitexturemanager_p.h @@ -161,9 +161,9 @@ public: // De-associate the given APITexture from the backend node. If the texture // is no longer referenced by any other node, it will be deleted. - void abandon(APITexture *tex, const Texture *node) + void abandon(APITexture *tex, const Qt3DCore::QNodeId nodeId) { - APITexture *apiTexture = m_nodeIdToGLTexture.take(node->peerId()); + APITexture *apiTexture = m_nodeIdToGLTexture.take(nodeId); Q_ASSERT(tex == apiTexture); if (Q_UNLIKELY(!apiTexture)) { @@ -176,7 +176,7 @@ public: m_abandonedTextures.push_back(apiTexture); } else { QVector<Qt3DCore::QNodeId> &referencedTextureNodes = m_sharedTextures[apiTexture]; - referencedTextureNodes.removeAll(node->peerId()); + referencedTextureNodes.removeAll(nodeId); // If no texture nodes is referencing the shared APITexture, remove it if (referencedTextureNodes.empty()) { |