diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-10-12 17:33:51 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-10-14 07:44:04 +0000 |
commit | 9e15fb156a0ef58584661a0599f1f85d7597e87c (patch) | |
tree | 05e02f031bcdfef65c7c342218fdc0f574e63356 /src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | |
parent | 83cd7c27ae3d733537cd2cbf54a3ddf0a3c7bb99 (diff) |
Handle QSG_NO_DEPTH_BUFFER correctly
Just not requesting a depth buffer is insufficient since there's nothing
guaranteeing that the EGL or other implementation will return depthless
configs. When the depth buffer is always there, setting the environment
variable is futile. To do what the user has requested, the value has to
be checked in the renderer too.
Change-Id: I1f572bc6f2f5b5aa94070a239d6e871e3421a51f
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 8632ea0b52..60ada14c32 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -821,7 +821,8 @@ Renderer::Renderer(QSGRenderContext *ctx) m_vao->create(); } - m_useDepthBuffer = ctx->openglContext()->format().depthBufferSize() > 0; + bool useDepth = qEnvironmentVariableIsEmpty("QSG_NO_DEPTH_BUFFER"); + m_useDepthBuffer = useDepth && ctx->openglContext()->format().depthBufferSize() > 0; } static void qsg_wipeBuffer(Buffer *buffer, QOpenGLFunctions *funcs) @@ -1087,8 +1088,10 @@ void Renderer::nodeWasRemoved(Node *node) e->removed = true; m_elementsToDelete.add(e); - if (m_renderNodeElements.isEmpty()) - m_useDepthBuffer = context()->openglContext()->format().depthBufferSize() > 0; + if (m_renderNodeElements.isEmpty()) { + static bool useDepth = qEnvironmentVariableIsEmpty("QSG_NO_DEPTH_BUFFER"); + m_useDepthBuffer = useDepth && context()->openglContext()->format().depthBufferSize() > 0; + } } } |