Nameless Engine
Loading...
Searching...
No Matches
PipelineConfiguration.h
1#pragma once
2
3// Standard.
4#include <set>
5#include <optional>
6
7// Custom.
8#include "render/general/pipeline/PipelineType.hpp"
9#include "shader/general/ShaderMacro.h"
10
11namespace ne {
13 enum class PipelineShadowMappingUsage : unsigned char {
14 DIRECTIONAL_AND_SPOT_LIGHTS,
15 POINT_LIGHTS,
16 };
17
25 public:
26 PipelineConfiguration() = delete;
27 virtual ~PipelineConfiguration() = default;
28
36 std::set<ShaderMacro> getRequiredVertexShaderMacros() const { return requiredVertexShaderMacros; }
37
46 virtual std::set<ShaderMacro> getRequiredFragmentShaderMacros() const { return {}; }
47
53 std::string_view getVertexShaderName() const { return sVertexShaderName; }
54
60 virtual std::optional<GraphicsPipelineType> getGraphicsType() const = 0;
61
67 virtual std::string_view getFragmentShaderName() const { return ""; }
68
74 virtual std::string_view getComputeShaderName() const { return ""; }
75
81 virtual bool isPixelBlendingEnabled() const { return false; }
82
88 virtual bool isDepthBiasEnabled() const { return false; }
89
96 virtual std::optional<PipelineShadowMappingUsage> getShadowMappingUsage() const { return {}; }
97
98 protected:
107 const std::string& sVertexShaderName, const std::set<ShaderMacro>& requiredVertexShaderMacros);
108
114 std::set<ShaderMacro> requiredVertexShaderMacros;
115
117 const std::string sVertexShaderName;
118 };
119
122 public:
124 virtual ~ColorPipelineConfiguration() override = default;
125
138 const std::string& sVertexShaderName,
139 const std::set<ShaderMacro>& requiredVertexShaderMacros,
140 const std::string& sFragmentShaderName,
141 const std::set<ShaderMacro>& requiredFragmentShaderMacros,
142 bool bUsePixelBlending);
143
149 virtual std::optional<GraphicsPipelineType> getGraphicsType() const override;
150
157 virtual std::set<ShaderMacro> getRequiredFragmentShaderMacros() const override;
158
164 virtual std::string_view getFragmentShaderName() const override;
165
171 virtual bool isPixelBlendingEnabled() const override;
172
173 protected:
179 std::set<ShaderMacro> requiredFragmentShaderMacros;
180
182 const std::string sFragmentShaderName;
183
186 };
187
190 public:
192 virtual ~DepthPipelineConfiguration() override = default;
193
204 const std::string& sVertexShaderName,
205 const std::set<ShaderMacro>& additionalVertexShaderMacros,
206 std::optional<PipelineShadowMappingUsage> shadowMappingUsage);
207
213 virtual std::optional<GraphicsPipelineType> getGraphicsType() const override;
214
220 virtual bool isDepthBiasEnabled() const override;
221
227 virtual std::string_view getFragmentShaderName() const override;
228
235 virtual std::optional<PipelineShadowMappingUsage> getShadowMappingUsage() const override;
236
237 protected:
239 const std::optional<PipelineShadowMappingUsage> shadowMappingUsage;
240 };
241
244 public:
246 virtual ~ComputePipelineConfiguration() override = default;
247
254
260 virtual std::optional<GraphicsPipelineType> getGraphicsType() const override;
261
267 virtual std::string_view getComputeShaderName() const override;
268
269 private:
271 const std::string sComputeShaderName;
272 };
273}
Definition: PipelineConfiguration.h:121
std::set< ShaderMacro > requiredFragmentShaderMacros
Definition: PipelineConfiguration.h:179
virtual std::set< ShaderMacro > getRequiredFragmentShaderMacros() const override
Definition: PipelineConfiguration.cpp:26
const std::string sFragmentShaderName
Definition: PipelineConfiguration.h:182
const bool bUsePixelBlending
Definition: PipelineConfiguration.h:185
virtual bool isPixelBlendingEnabled() const override
Definition: PipelineConfiguration.cpp:32
virtual std::optional< GraphicsPipelineType > getGraphicsType() const override
Definition: PipelineConfiguration.cpp:18
virtual std::string_view getFragmentShaderName() const override
Definition: PipelineConfiguration.cpp:30
Definition: PipelineConfiguration.h:243
virtual std::optional< GraphicsPipelineType > getGraphicsType() const override
Definition: PipelineConfiguration.cpp:81
virtual std::string_view getComputeShaderName() const override
Definition: PipelineConfiguration.cpp:83
const std::string sComputeShaderName
Definition: PipelineConfiguration.h:271
Definition: PipelineConfiguration.h:189
virtual std::string_view getFragmentShaderName() const override
Definition: PipelineConfiguration.cpp:60
virtual bool isDepthBiasEnabled() const override
Definition: PipelineConfiguration.cpp:58
virtual std::optional< GraphicsPipelineType > getGraphicsType() const override
Definition: PipelineConfiguration.cpp:46
const std::optional< PipelineShadowMappingUsage > shadowMappingUsage
Definition: PipelineConfiguration.h:239
virtual std::optional< PipelineShadowMappingUsage > getShadowMappingUsage() const override
Definition: PipelineConfiguration.cpp:70
Definition: PipelineConfiguration.h:24
std::set< ShaderMacro > requiredVertexShaderMacros
Definition: PipelineConfiguration.h:114
virtual std::set< ShaderMacro > getRequiredFragmentShaderMacros() const
Definition: PipelineConfiguration.h:46
virtual std::optional< PipelineShadowMappingUsage > getShadowMappingUsage() const
Definition: PipelineConfiguration.h:96
virtual std::optional< GraphicsPipelineType > getGraphicsType() const =0
std::set< ShaderMacro > getRequiredVertexShaderMacros() const
Definition: PipelineConfiguration.h:36
const std::string sVertexShaderName
Definition: PipelineConfiguration.h:117
std::string_view getVertexShaderName() const
Definition: PipelineConfiguration.h:53
virtual std::string_view getComputeShaderName() const
Definition: PipelineConfiguration.h:74
virtual bool isDepthBiasEnabled() const
Definition: PipelineConfiguration.h:88
virtual std::string_view getFragmentShaderName() const
Definition: PipelineConfiguration.h:67
virtual bool isPixelBlendingEnabled() const
Definition: PipelineConfiguration.h:81