summaryrefslogtreecommitdiffstats
path: root/src/render/graphicshelpers/graphicscontext.cpp
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2016-04-15 13:55:03 +0100
committerSean Harmer <sean.harmer@kdab.com>2016-04-17 12:26:08 +0000
commitbef819368d861f386be44714f7c8d053c1bb2734 (patch)
treec290321da683c6d7b439183fb3491c837b6946a9 /src/render/graphicshelpers/graphicscontext.cpp
parent042c380b5885d15925bf66400ebeaa1dc0e7dda0 (diff)
Remove shader from cache in graphics context cache when deleted
Stops assert firing when trying to use a recycled Shader Change-Id: Ifa18143a145654fd3f9e381627406e907a9e2d48 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/graphicshelpers/graphicscontext.cpp')
-rw-r--r--src/render/graphicshelpers/graphicscontext.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/render/graphicshelpers/graphicscontext.cpp b/src/render/graphicshelpers/graphicscontext.cpp
index 8bc7d6d6f..c1913362d 100644
--- a/src/render/graphicshelpers/graphicscontext.cpp
+++ b/src/render/graphicshelpers/graphicscontext.cpp
@@ -429,6 +429,13 @@ QOpenGLShaderProgram *GraphicsContext::containsProgram(const ProgramDNA &dna)
return Q_NULLPTR;
}
+void GraphicsContext::removeProgram(const ProgramDNA &dna, Qt3DCore::QNodeId id)
+{
+ Shader *renderShader = m_renderShaderHash.value(dna, nullptr);
+ if (renderShader && renderShader->peerId() == id)
+ m_renderShaderHash.remove(dna);
+}
+
void GraphicsContext::activateRenderTarget(RenderTarget *renderTarget, const AttachmentPack &attachments, GLuint defaultFboId)
{
GLuint fboId = defaultFboId; // Default FBO