diff options
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index c34327bb41..913533b389 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -4444,6 +4444,9 @@ void Renderer::renderRenderNode(Batch *batch) // legacy (GL-only) opacity = opacity->parent(); } + // having DepthAwareRendering leaves depth test on in the alpha pass + const bool depthTestWasEnabled = m_useDepthBuffer; + glDisable(GL_STENCIL_TEST); glDisable(GL_SCISSOR_TEST); glDisable(GL_DEPTH_TEST); @@ -4478,7 +4481,9 @@ void Renderer::renderRenderNode(Batch *batch) // legacy (GL-only) m_currentClipType = ClipState::NoClip; } - if (changes & QSGRenderNode::DepthState) + if (depthTestWasEnabled) + glEnable(GL_DEPTH_TEST); + else if (changes & QSGRenderNode::DepthState) glDisable(GL_DEPTH_TEST); if (changes & QSGRenderNode::ColorState) |