1// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "memorybarrier_p.h"
5#include <Qt3DRender/private/qmemorybarrier_p.h>
6
7QT_BEGIN_NAMESPACE
8
9namespace Qt3DRender {
10
11namespace Render {
12
13MemoryBarrier::MemoryBarrier()
14 : FrameGraphNode(FrameGraphNode::MemoryBarrier)
15 , m_waitOperations(QMemoryBarrier::None)
16{
17}
18
19MemoryBarrier::~MemoryBarrier()
20{
21}
22
23QMemoryBarrier::Operations MemoryBarrier::waitOperations() const
24{
25 return m_waitOperations;
26}
27
28void MemoryBarrier::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime)
29{
30 const QMemoryBarrier *node = qobject_cast<const QMemoryBarrier *>(object: frontEnd);
31 if (!node)
32 return;
33
34 FrameGraphNode::syncFromFrontEnd(frontEnd, firstTime);
35
36 if (node->waitOperations() != m_waitOperations) {
37 m_waitOperations = node->waitOperations();
38 markDirty(changes: AbstractRenderer::FrameGraphDirty);
39 }
40}
41
42} // Render
43
44} // Qt3DRender
45
46QT_END_NAMESPACE
47

source code of qt3d/src/render/framegraph/memorybarrier.cpp