aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2016-12-06 14:35:56 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2016-12-09 11:29:01 +0000
commita1c6480360560ba73d9d4797ed970103c53ba7a4 (patch)
tree2156f274aced16fd8d4dd21640e56be5972ed460 /src/quick/scenegraph
parent012142e97ee7a9cc1e7740d1730085efd37bc91f (diff)
Fix projection matrix for DepthAware QSGRenderNodes
Unlike renderUnmergedBatches(), renderRenderNode() did not adjust the projection matrix. Change-Id: Ie8ab0024a5f743ae30fe469f694805f803116613 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index 81aa641e03..ae13163ea7 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -2775,8 +2775,13 @@ void Renderer::renderRenderNode(Batch *batch)
updateClip(rd->m_clip_list, batch);
- RenderNodeState state;
QMatrix4x4 pm = projectionMatrix();
+ if (m_useDepthBuffer) {
+ pm(2, 2) = m_zRange;
+ pm(2, 3) = 1.0f - e->order * m_zRange;
+ }
+
+ RenderNodeState state;
state.m_projectionMatrix = &pm;
state.m_scissorEnabled = m_currentClipType & ScissorClip;
state.m_stencilEnabled = m_currentClipType & StencilClip;