summaryrefslogtreecommitdiffstats
path: root/src/render/renderers/opengl/graphicshelpers
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/renderers/opengl/graphicshelpers')
-rw-r--r--src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp8
-rw-r--r--src/render/renderers/opengl/graphicshelpers/submissioncontext_p.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp
index 47779dded..b8229dd9e 100644
--- a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp
+++ b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp
@@ -506,6 +506,14 @@ void SubmissionContext::activateRenderTarget(Qt3DCore::QNodeId renderTargetNodeI
activateDrawBuffers(attachments);
}
+void SubmissionContext::releaseRenderTarget(const Qt3DCore::QNodeId id)
+{
+ if (m_renderTargets.contains(id)) {
+ const GLuint fboId = m_renderTargets.take(id);
+ m_glHelper->releaseFrameBufferObject(fboId);
+ }
+}
+
GLuint SubmissionContext::createRenderTarget(Qt3DCore::QNodeId renderTargetNodeId, const AttachmentPack &attachments)
{
const GLuint fboId = m_glHelper->createFrameBufferObject();
diff --git a/src/render/renderers/opengl/graphicshelpers/submissioncontext_p.h b/src/render/renderers/opengl/graphicshelpers/submissioncontext_p.h
index a8700dd3a..0f769fa1c 100644
--- a/src/render/renderers/opengl/graphicshelpers/submissioncontext_p.h
+++ b/src/render/renderers/opengl/graphicshelpers/submissioncontext_p.h
@@ -111,6 +111,7 @@ public:
// FBO
GLuint activeFBO() const { return m_activeFBO; }
void activateRenderTarget(const Qt3DCore::QNodeId id, const AttachmentPack &attachments, GLuint defaultFboId);
+ void releaseRenderTarget(const Qt3DCore::QNodeId id);
QSize renderTargetSize(const QSize &surfaceSize) const;
QImage readFramebuffer(const QRect &rect);
void blitFramebuffer(Qt3DCore::QNodeId outputRenderTargetId, Qt3DCore::QNodeId inputRenderTargetId,