diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-08-16 14:21:15 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-08-22 16:10:24 +0200 |
commit | 7dcdf3b7ae27cd26b84731941f5b1f380c5b3316 (patch) | |
tree | 90f5641dc9d4951c7318328d0a205a30a500f775 /src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | |
parent | ef2715251e1785e273873e4000ed08fd99962ab7 (diff) |
rendernode example: Add support for Metal
Plus clarify QQuickWindow::begin/endExternalCommands() in combination
with QSGRenderNode in the docs. As the example demonstrates, calling
these functions is not necessary within render() of a render node.
Also fix an issue with resetting the scissor in the renderer after
calling render() of a QSGRenderNode.
Change-Id: If8c2dab38d62aa444266d37901f062a51e767f68
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
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 293cc4cb6b..2441e14fda 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -4563,11 +4563,14 @@ void Renderer::renderRhiRenderNode(const Batch *batch) // split prepare-render ( rd->m_matrix = nullptr; rd->m_clip_list = nullptr; - if (changes & QSGRenderNode::ViewportState) + if ((changes & QSGRenderNode::ViewportState) + || (changes & QSGRenderNode::ScissorState)) + { + // Reset both flags if either is reported as changed, since with the rhi + // it could be setViewport() that will record the resetting of the scissor. m_pstate.viewportSet = false; - - if (changes & QSGRenderNode::ScissorState) m_pstate.scissorSet = false; + } // Do not bother with RenderTargetState. Where applicable, endExternal() // ensures the correct target is rebound. For others (like Vulkan) it makes |