1// Copyright (C) 2016 Paul Lemire
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QT3DRENDER_RENDER_MATERIALPARAMETERGATHERERJOB_P_H
5#define QT3DRENDER_RENDER_MATERIALPARAMETERGATHERERJOB_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#include <Qt3DCore/qaspectjob.h>
19#include <Qt3DCore/qnodeid.h>
20#include <Qt3DRender/private/handle_types_p.h>
21#include <Qt3DRender/private/qt3drender_global_p.h>
22#include <Qt3DRender/private/renderviewjobutils_p.h>
23
24QT_BEGIN_NAMESPACE
25
26namespace Qt3DRender {
27
28namespace Render {
29
30class NodeManagers;
31class TechniqueFilter;
32class RenderPassFilter;
33
34// TO be executed for each FrameGraph branch with a given RenderPassFilter/TechniqueFilter
35class MaterialParameterGathererJobPrivate;
36
37class Q_3DRENDERSHARED_PRIVATE_EXPORT MaterialParameterGathererJob : public Qt3DCore::QAspectJob
38{
39public:
40 MaterialParameterGathererJob();
41
42 inline void setNodeManagers(NodeManagers *manager) noexcept { m_manager = manager; }
43 inline void setTechniqueFilter(TechniqueFilter *techniqueFilter) noexcept { m_techniqueFilter = techniqueFilter; }
44 inline void setRenderPassFilter(RenderPassFilter *renderPassFilter) noexcept { m_renderPassFilter = renderPassFilter; }
45 inline const MaterialParameterGathererData &materialToPassAndParameter() noexcept { return m_parameters; }
46 inline void setHandles(std::vector<HMaterial> &&handles) noexcept { m_handles = std::move(handles); }
47 inline void setHandles(const std::vector<HMaterial> &handles) noexcept { m_handles = handles; }
48
49 inline TechniqueFilter *techniqueFilter() const noexcept { return m_techniqueFilter; }
50 inline RenderPassFilter *renderPassFilter() const noexcept { return m_renderPassFilter; }
51
52 void run() final;
53
54private:
55 NodeManagers *m_manager;
56 TechniqueFilter *m_techniqueFilter;
57 RenderPassFilter *m_renderPassFilter;
58
59 // Material id to array of RenderPasse with parameters
60 MaterialParameterGathererData m_parameters;
61 std::vector<HMaterial> m_handles;
62
63 Q_DECLARE_PRIVATE(MaterialParameterGathererJob)
64};
65
66typedef QSharedPointer<MaterialParameterGathererJob> MaterialParameterGathererJobPtr;
67
68} // Render
69
70} // Qt3DRender
71
72QT_END_NAMESPACE
73
74#endif // QT3DRENDER_RENDER_MATERIALPARAMETERGATHERERJOB_P_H
75

source code of qt3d/src/render/jobs/materialparametergathererjob_p.h