summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@sletta.org>2016-04-27 12:57:00 +0200
committerGunnar Sletta <gunnar@sletta.org>2016-04-28 08:53:04 +0000
commit657d33acba8acc1fd6b000ec74da9f4f3a48b743 (patch)
tree5c6f9da16bd02299052ae7d845bef71f7ebc4363
parenta4d55a789d4424a95a55f5225a7dc0b4dd12d885 (diff)
Reset clipping state after a completed frame.
Failing to do so, will result in clip being wrong on the following frames. Change-Id: If3a5f9c7ecb056d6cf2c50fe2f326abeaad0ddb8 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
-rw-r--r--customcontext/renderer/qsgbasicclipmanager_p.h9
-rw-r--r--customcontext/renderer/simplerenderer.cpp1
2 files changed, 10 insertions, 0 deletions
diff --git a/customcontext/renderer/qsgbasicclipmanager_p.h b/customcontext/renderer/qsgbasicclipmanager_p.h
index e75d5a9..76c06d0 100644
--- a/customcontext/renderer/qsgbasicclipmanager_p.h
+++ b/customcontext/renderer/qsgbasicclipmanager_p.h
@@ -78,6 +78,15 @@ public:
template<typename ClipRenderer, typename ShaderStateTracker>
void activate(const QSGClipNode *clip, ClipRenderer *clipRenderer, ShaderStateTracker *tracker, QOpenGLFunctions *gl);
+ void reset(QOpenGLFunctions *gl) {
+ if (m_clipType & StencilClip)
+ gl->glDisable(GL_STENCIL_TEST);
+ if (m_clipType & ScissorClip)
+ gl->glDisable(GL_SCISSOR_TEST);
+ m_clipType = NoClip;
+ m_currentClip = 0;
+ }
+
ClipType clipType() const { return m_clipType; }
const QSGClipNode *currentClip() const { return m_currentClip; }
diff --git a/customcontext/renderer/simplerenderer.cpp b/customcontext/renderer/simplerenderer.cpp
index 037c82c..00e0f58 100644
--- a/customcontext/renderer/simplerenderer.cpp
+++ b/customcontext/renderer/simplerenderer.cpp
@@ -434,6 +434,7 @@ void Renderer::renderElements()
}
}
+ m_clipManager->reset(this);
m_shaderManager->endFrame(this);
}