1 | // Copyright (C) 2018 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 "waitfence_p.h" |
5 | #include <Qt3DRender/private/qwaitfence_p.h> |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists for the convenience |
12 | // of other Qt classes. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | |
19 | QT_BEGIN_NAMESPACE |
20 | |
21 | namespace Qt3DRender { |
22 | |
23 | namespace Render { |
24 | |
25 | WaitFence::WaitFence() |
26 | : FrameGraphNode(FrameGraphNode::WaitFence) |
27 | { |
28 | m_data.handleType = QWaitFence::NoHandle; |
29 | m_data.waitOnCPU = false; |
30 | m_data.timeout = std::numeric_limits<quint64>::max(); |
31 | } |
32 | |
33 | WaitFence::~WaitFence() |
34 | { |
35 | } |
36 | |
37 | void WaitFence::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) |
38 | { |
39 | const QWaitFence *node = qobject_cast<const QWaitFence *>(object: frontEnd); |
40 | if (!node) |
41 | return; |
42 | |
43 | FrameGraphNode::syncFromFrontEnd(frontEnd, firstTime); |
44 | |
45 | if (node->handleType() != m_data.handleType) { |
46 | m_data.handleType = node->handleType(); |
47 | markDirty(changes: AbstractRenderer::FrameGraphDirty); |
48 | } |
49 | if (node->handle() != m_data.handle) { |
50 | m_data.handle = node->handle(); |
51 | markDirty(changes: AbstractRenderer::FrameGraphDirty); |
52 | } |
53 | if (node->timeout() != m_data.timeout) { |
54 | m_data.timeout = node->timeout(); |
55 | markDirty(changes: AbstractRenderer::FrameGraphDirty); |
56 | } |
57 | if (node->waitOnCPU() != m_data.waitOnCPU) { |
58 | m_data.waitOnCPU = node->waitOnCPU(); |
59 | markDirty(changes: AbstractRenderer::FrameGraphDirty); |
60 | } |
61 | } |
62 | |
63 | } // namespace Render |
64 | |
65 | } // namespace Qt3DRender |
66 | |
67 | QT_END_NAMESPACE |
68 |