16#ifndef AEONGAMES_PIPELINE_H
17#define AEONGAMES_PIPELINE_H
27#include "aeongames/Material.hpp"
28#include "aeongames/Resource.hpp"
57 VertexPositionBit = 0x1,
58 VertexNormalBit = 0x2,
59 VertexTangentBit = 0x4,
60 VertexBitangentBit = 0x8,
62 VertexWeightIdxBit = 0x20,
63 VertexWeightBit = 0x40,
64 VertexColorBit = 0x80,
65 VertexAllBits = VertexPositionBit |
80 Vector4ByteNormalized,
110 {
FRAG,
"fragment" },
112 {
TESC,
"tessellation control" },
113 {
TESE,
"tessellation evaluation" },
137 DLL
void LoadFromMemory (
const void* aBuffer,
size_t aBufferSize )
final;
145 DLL
const std::string& GetVertexShaderCode()
const;
146 DLL
const std::string& GetFragmentShaderCode()
const;
147 DLL
const std::vector<std::tuple<UniformType, std::string >> & GetUniformDescriptors()
const;
148 DLL
const std::vector<std::string>& GetSamplerDescriptors()
const;
149 DLL std::string GetProperties ()
const;
151 DLL uint32_t GetAttributeBitmap()
const;
166 std::string mVertexShaderCode{};
167 std::string mFragmentShaderCode{};
168 std::vector<std::tuple<UniformType, std::string >> mUniformDescriptors{};
169 std::vector<std::string> mSamplerDescriptors{};
171 std::array<std::string, ShaderType::COUNT> mShaderCode {};
static const uint32_t TOPOLOGY_CLASS_POINT
Point topology class bitmask.
DLL void Unload() final
Release all pipeline resources.
static const uint32_t TOPOLOGY_CLASS_LINE
Line topology class bitmask.
static const uint32_t TOPOLOGY_CLASS_TRIANGLE
Triangle topology class bitmask.
DLL const std::string_view GetShaderCode(ShaderType aType) const
Get the shader source code for the given shader stage.
virtual DLL ~Pipeline()
Virtual destructor.
DLL void LoadFromMemory(const void *aBuffer, size_t aBufferSize) final
Load pipeline data from a memory buffer.
DLL void LoadFromPBMsg(const PipelineMsg &aPipelineMsg)
Load pipeline configuration from a protobuf message.
DLL uint32_t GetTopologyClass() const
Get the topology class bitmask for this pipeline.
static const uint32_t TOPOLOGY_CLASS_PATCH
Patch topology class bitmask.
DLL Pipeline()
Default constructor.
Base class for loadable engine resources.
<- This is here just for the literals
DLL uint32_t GetAttributes(const PipelineMsg &aPipelineMsg)
Get the packed attribute flags from a pipeline message.
const std::unordered_map< ShaderType, const char * > ShaderTypeToString
Map from ShaderType enum values to human-readable string names.
ShaderType
Shader stage types.
@ COUNT
Number of shader types.
@ TESC
Tessellation control shader.
@ TESE
Tessellation evaluation shader.
Topology
Primitive topology types for rendering.
@ TRIANGLE_STRIP
Connected triangle strip.
@ PATCH_LIST
Patch list for tessellation.
@ LINE_LIST_WITH_ADJACENCY
Line list with adjacency information.
@ TRIANGLE_LIST_WITH_ADJACENCY
Triangle list with adjacency information.
@ POINT_LIST
List of individual points.
@ UNDEFINED
Undefined topology.
@ LINE_STRIP
Connected line segments.
@ LINE_LIST
Pairs of vertices forming individual lines.
@ TRIANGLE_LIST
Independent triangles.
@ TRIANGLE_STRIP_WITH_ADJACENCY
Triangle strip with adjacency information.
@ TRIANGLE_FAN
Triangles sharing a common vertex.
@ LINE_STRIP_WITH_ADJACENCY
Line strip with adjacency information.