summaryrefslogtreecommitdiffstats
path: root/src/render/renderers/opengl/renderer/renderer.cpp
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2020-02-13 11:51:38 +0100
committerPaul Lemire <paul.lemire@kdab.com>2020-02-13 15:59:51 +0100
commit294894610b02a2cd4682fafe139a60b2b96f3289 (patch)
tree70dc752d85d8b10df0f75be56c1fa2b5c12822c4 /src/render/renderers/opengl/renderer/renderer.cpp
parentd046e7cc3e362e6cb45afd5ecae464d796c21079 (diff)
Destroy FBOs when RenderTarget node is destroyed
It appears we never destroyed FBOs which lead to bugs when destroying and recreating a RenderTarget Change-Id: I99b3df95b821670aa3bbd63209ff9bcc21afbf79 Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/render/renderers/opengl/renderer/renderer.cpp')
-rw-r--r--src/render/renderers/opengl/renderer/renderer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/render/renderers/opengl/renderer/renderer.cpp b/src/render/renderers/opengl/renderer/renderer.cpp
index d61d1d8ac..3e5bef3cd 100644
--- a/src/render/renderers/opengl/renderer/renderer.cpp
+++ b/src/render/renderers/opengl/renderer/renderer.cpp
@@ -1397,6 +1397,13 @@ void Renderer::updateGLResources()
// Record list of buffer that might need uploading
lookForDownloadableBuffers();
+
+ // Remove destroyed FBOs
+ {
+ const QNodeIdVector destroyedRenderTargetIds = m_nodesManager->renderTargetManager()->takeRenderTargetIdsToCleanup();
+ for (const Qt3DCore::QNodeId &renderTargetId : destroyedRenderTargetIds)
+ m_submissionContext->releaseRenderTarget(renderTargetId);
+ }
}
// Render Thread