1 | // Copyright (C) 2014 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 "rendercommand_p.h" |
5 | |
6 | QT_BEGIN_NAMESPACE |
7 | |
8 | namespace Qt3DRender { |
9 | namespace Render { |
10 | namespace OpenGL { |
11 | |
12 | RenderCommand::RenderCommand() |
13 | : m_glShader(nullptr) |
14 | , m_stateSet(nullptr) |
15 | , m_depth(0.0f) |
16 | , m_changeCost(0) |
17 | , m_type(RenderCommand::Draw) |
18 | , m_primitiveCount(0) |
19 | , m_primitiveType(QGeometryRenderer::Triangles) |
20 | , m_restartIndexValue(-1) |
21 | , m_firstInstance(0) |
22 | , m_firstVertex(0) |
23 | , m_verticesPerPatch(0) |
24 | , m_instanceCount(0) |
25 | , m_indexOffset(0) |
26 | , m_indexAttributeByteOffset(0) |
27 | , m_indexAttributeDataType(GL_UNSIGNED_SHORT) |
28 | , m_indirectAttributeByteOffset(0) |
29 | , m_drawIndexed(false) |
30 | , m_drawIndirect(false) |
31 | , m_primitiveRestartEnabled(false) |
32 | , m_isValid(false) |
33 | { |
34 | m_workGroups[0] = 0; |
35 | m_workGroups[1] = 0; |
36 | m_workGroups[2] = 0; |
37 | } |
38 | |
39 | bool operator==(const RenderCommand &a, const RenderCommand &b) noexcept |
40 | { |
41 | return (a.m_vao == b.m_vao && a.m_glShader == b.m_glShader && a.m_material == b.m_material && |
42 | a.m_stateSet == b.m_stateSet && a.m_geometry == b.m_geometry && a.m_geometryRenderer == b.m_geometryRenderer && |
43 | a.m_indirectDrawBuffer == b.m_indirectDrawBuffer && a.m_activeAttributes == b.m_activeAttributes && |
44 | a.m_depth == b.m_depth && a.m_changeCost == b.m_changeCost && a.m_shaderId == b.m_shaderId && |
45 | a.m_workGroups[0] == b.m_workGroups[0] && a.m_workGroups[1] == b.m_workGroups[1] && a.m_workGroups[2] == b.m_workGroups[2] && |
46 | a.m_primitiveCount == b.m_primitiveCount && a.m_primitiveType == b.m_primitiveType && a.m_restartIndexValue == b.m_restartIndexValue && |
47 | a.m_firstInstance == b.m_firstInstance && a.m_firstVertex == b.m_firstVertex && a.m_verticesPerPatch == b.m_verticesPerPatch && |
48 | a.m_instanceCount == b.m_instanceCount && a.m_indexOffset == b.m_indexOffset && a.m_indexAttributeByteOffset == b.m_indexAttributeByteOffset && |
49 | a.m_drawIndexed == b.m_drawIndexed && a.m_drawIndirect == b.m_drawIndirect && a.m_primitiveRestartEnabled == b.m_primitiveRestartEnabled && |
50 | a.m_isValid == b.m_isValid && a.m_computeCommand == b.m_computeCommand); |
51 | } |
52 | |
53 | } // namespace OpenGL |
54 | } // namespace Render |
55 | } // namespace Qt3DRender |
56 | |
57 | QT_END_NAMESPACE |
58 | |