Plasma Engine  2.0
Loading...
Searching...
No Matches
RenderPipelineNode.h
1#pragma once
2
3#include <Foundation/Reflection/Reflection.h>
4#include <Foundation/Strings/HashedString.h>
5#include <RendererCore/Declarations.h>
6
8
10{
11 PL_DECLARE_POD_TYPE();
12
13 struct Type
14 {
15 using StorageType = plUInt8;
16
17 enum Enum
18 {
19 Input = PL_BIT(0),
20 Output = PL_BIT(1),
21 PassThrough = PL_BIT(2),
22 TextureProvider = PL_BIT(3),
23
24 Default = 0
25 };
26
27 struct Bits
28 {
29 StorageType Input : 1;
30 StorageType Output : 1;
31 StorageType PassThrough : 1;
32 StorageType TextureProvider : 1;
33 };
34 };
35
36 plBitflags<Type> m_Type;
37 plUInt8 m_uiInputIndex = 0xFF;
38 plUInt8 m_uiOutputIndex = 0xFF;
39 plRenderPipelineNode* m_pParent = nullptr;
40};
41PL_DECLARE_FLAGS_OPERATORS(plRenderPipelineNodePin::Type);
42
44{
45 PL_DECLARE_POD_TYPE();
46
47 PL_ALWAYS_INLINE plRenderPipelineNodeInputPin() { m_Type = Type::Input; }
48};
49
51{
52 PL_DECLARE_POD_TYPE();
53
54 PL_ALWAYS_INLINE plRenderPipelineNodeOutputPin() { m_Type = Type::Output; }
55};
56
58{
59 PL_DECLARE_POD_TYPE();
60
61 PL_ALWAYS_INLINE plRenderPipelineNodeInputProviderPin() { m_Type = Type::Input | Type::TextureProvider; }
62};
63
65{
66 PL_DECLARE_POD_TYPE();
67
68 PL_ALWAYS_INLINE plRenderPipelineNodeOutputProviderPin() { m_Type = Type::Output | Type::TextureProvider; }
69};
70
72{
73 PL_DECLARE_POD_TYPE();
74
75 PL_ALWAYS_INLINE plRenderPipelineNodePassThroughPin() { m_Type = Type::PassThrough; }
76};
77
78class PL_RENDERERCORE_DLL plRenderPipelineNode : public plReflectedClass
79{
80 PL_ADD_DYNAMIC_REFLECTION(plRenderPipelineNode, plReflectedClass);
81
82public:
83 virtual ~plRenderPipelineNode() = default;
84
85 void InitializePins();
86
87 plHashedString GetPinName(const plRenderPipelineNodePin* pPin) const;
88 const plRenderPipelineNodePin* GetPinByName(const char* szName) const;
89 const plRenderPipelineNodePin* GetPinByName(plHashedString sName) const;
90 const plArrayPtr<const plRenderPipelineNodePin* const> GetInputPins() const { return m_InputPins; }
91 const plArrayPtr<const plRenderPipelineNodePin* const> GetOutputPins() const { return m_OutputPins; }
92
93private:
97};
98
99PL_DECLARE_REFLECTABLE_TYPE(PL_RENDERERCORE_DLL, plRenderPipelineNodePin);
100PL_DECLARE_REFLECTABLE_TYPE(PL_RENDERERCORE_DLL, plRenderPipelineNodeInputPin);
101PL_DECLARE_REFLECTABLE_TYPE(PL_RENDERERCORE_DLL, plRenderPipelineNodeOutputPin);
102PL_DECLARE_REFLECTABLE_TYPE(PL_RENDERERCORE_DLL, plRenderPipelineNodeInputProviderPin);
103PL_DECLARE_REFLECTABLE_TYPE(PL_RENDERERCORE_DLL, plRenderPipelineNodeOutputProviderPin);
104PL_DECLARE_REFLECTABLE_TYPE(PL_RENDERERCORE_DLL, plRenderPipelineNodePassThroughPin);
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
Definition DynamicArray.h:81
Definition HashTable.h:333
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
Definition RenderPipelineNode.h:79
The plBitflags class allows you to work with type-safe bitflags.
Definition Bitflags.h:82
Definition RenderPipelineNode.h:44
Definition RenderPipelineNode.h:58
Definition RenderPipelineNode.h:51
Definition RenderPipelineNode.h:65
Definition RenderPipelineNode.h:72
Definition RenderPipelineNode.h:28
Definition RenderPipelineNode.h:14
Enum
Definition RenderPipelineNode.h:18
@ TextureProvider
Pass provides pin texture to the pipeline each frame.
Definition RenderPipelineNode.h:22
Definition RenderPipelineNode.h:10