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 | |
7 | QT_BEGIN_NAMESPACE |
8 | |
9 | namespace Qt3DRender { |
10 | |
11 | namespace Render { |
12 | |
13 | MemoryBarrier::MemoryBarrier() |
14 | : FrameGraphNode(FrameGraphNode::MemoryBarrier) |
15 | , m_waitOperations(QMemoryBarrier::None) |
16 | { |
17 | } |
18 | |
19 | MemoryBarrier::~MemoryBarrier() |
20 | { |
21 | } |
22 | |
23 | QMemoryBarrier::Operations MemoryBarrier::waitOperations() const |
24 | { |
25 | return m_waitOperations; |
26 | } |
27 | |
28 | void 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 | |
46 | QT_END_NAMESPACE |
47 |