119 .shaderSpecialization = std::move(shaderSpecialization),
140 .primitiveTopology = primitiveTopology,
141 .shaderSpecialization = std::move(shaderSpecialization),
163 return getPipeline(*mesh,
state, primitiveTopology, std::move(shaderSpecialization));
231 return get(
StringView(), shader, renderPass, pipelineLayout);
#define CE_FLAGS_OPERATORS(Enum)
Defines global operators for a Flags<Enum, Storage> implementation.
Definition Flags.hpp:216
#define CE_REFLECT_HASH(T)
Definition Hash.hpp:89
#define CE_REFL_DATA(N)
Definition Macros.hpp:541
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
A simple reference counter base class.
Definition SmartPtr.hpp:438
A renderer graphics pipeline.
Definition RendererGraphicsPipeline.hpp:60
const GPURenderPassPtr & getRenderPass() const noexcept
Pointer to a RenderPass object. By default null.
Definition RendererGraphicsPipeline.hpp:171
const String & getName() const noexcept
A human-readable name to use on the pipeline.
Definition RendererGraphicsPipeline.hpp:168
const GPUPipelineLayoutPtr & getPipelineLayout() const noexcept
Pointer to an optional pipeline layout for the graphics pipeline.
Definition RendererGraphicsPipeline.hpp:174
GPUGraphicsPipelinePtr getPipeline(const RendererMesh &mesh, const GPUGraphicsPipelineState &state, PrimitiveTopology primitiveTopology=PrimitiveTopology::Triangles, RendererShaderSpecialization shaderSpecialization={}) const
Gets the compiled graphics pipeline program suitable for the given mesh.
~RendererGraphicsPipeline()
RendererGraphicsPipelineManager & mManager
The renderer graphics pipeline manager that owns this graphics pipeline object.
Definition RendererGraphicsPipeline.hpp:66
GPUGraphicsPipelinePtr getPipeline(VertexDeclaration vertexDeclaration, const GPUGraphicsPipelineState &state, const PrimitiveTopology primitiveTopology=PrimitiveTopology::Triangles, RendererShaderSpecialization shaderSpecialization={}) const
Gets the compiled graphics pipeline program for the given parameters.
Definition RendererGraphicsPipeline.hpp:135
GPUPipelineLayoutPtr mPipelineLayout
Pointer to an optional pipeline layout for the graphics pipeline.
Definition RendererGraphicsPipeline.hpp:80
GPUGraphicsPipelinePtr getPipeline(const RendererGraphicsPipelineSpecialization &specialization) const
Gets the compiled graphics pipeline program for the given parameters.
GPURenderPassPtr mRenderPass
Pointer to a RenderPass object. By default null.
Definition RendererGraphicsPipeline.hpp:76
String mName
A human-readable name to use on the pipeline.
Definition RendererGraphicsPipeline.hpp:69
GPUGraphicsPipelinePtr getPipeline(const GPUGraphicsPipelineState &state, const PrimitiveTopology primitiveTopology=PrimitiveTopology::Triangles, RendererShaderSpecialization shaderSpecialization={}) const
Gets the compiled graphics pipeline program for the given parameters.
Definition RendererGraphicsPipeline.hpp:114
GPUGraphicsPipelinePtr getPipeline(const RendererMeshPtr &mesh, const GPUGraphicsPipelineState &state, const PrimitiveTopology primitiveTopology=PrimitiveTopology::Triangles, RendererShaderSpecialization shaderSpecialization={}) const
Definition RendererGraphicsPipeline.hpp:161
RendererShaderPtr mShader
The shader to be used when creating new GPU Graphics Pipeline instances.
Definition RendererGraphicsPipeline.hpp:73
HashMap< UInt64, GPUGraphicsPipelinePtr > mPipelines
The graphics pipeline programs, indexed by their parameters hash.
Definition RendererGraphicsPipeline.hpp:83
RendererGraphicsPipeline(RendererGraphicsPipelineManager &manager, StringView name, const RendererShaderPtr &shader, const GPURenderPassPtr &renderPass, const GPUPipelineLayoutPtr &pipelineLayout=nullptr)
Creates a new renderer graphics pipeline instance.
const RendererShaderPtr & getShader() const noexcept
The shader to be used when creating new GPU Graphics Pipeline instances.
Definition RendererGraphicsPipeline.hpp:177
The renderer graphics pipeline manager that is responsible for managing and re-using GPU graphics pip...
Definition RendererGraphicsPipeline.hpp:182
RendererGraphicsPipelinePtr getOrCreate(StringView name, const RendererShaderPtr &shader, const GPURenderPassPtr &renderPass, const GPUPipelineLayoutPtr &pipelineLayout)
Gets an existing or creates a new renderer graphics pipeline instance for the given base descriptor.
Renderer & mRenderer
The renderer that owns this manager instance.
Definition RendererGraphicsPipeline.hpp:193
RendererGraphicsPipelinePtr get(const RendererShaderPtr &shader, const GPURenderPassPtr &renderPass, const GPUPipelineLayoutPtr &pipelineLayout=nullptr)
Gets (or creates) a new RendererGraphicsPipeline from a graphics pipeline graphics pipeline program d...
Definition RendererGraphicsPipeline.hpp:229
HashMap< UInt64, GraphicsPipelineInfo > mGraphicsPipelines
A map that holds graphics pipeline information for each base graphics pipeline descriptor.
Definition RendererGraphicsPipeline.hpp:197
RendererGraphicsPipelineManager(Renderer &renderer)
Creates a new GraphicsPipeline Manager instance.
RendererGraphicsPipelinePtr get(StringView name, const RendererShaderPtr &shader, const GPURenderPassPtr &renderPass, const GPUPipelineLayoutPtr &pipelineLayout=nullptr)
Gets (or creates) a new RendererGraphicsPipeline from a graphics pipeline state descriptor.
void notifyDestroy(const RendererGraphicsPipeline *graphicsPipeline) noexcept
Notifies the manager that the renderer graphics pipeline is being destroyed.
The CeresEngine renderer.
Definition Renderer.hpp:35
A mesh that is usable by the renderer and the GPU.
Definition RendererMesh.hpp:95
Definition Application.hpp:19
BasicStringView< char > StringView
Narrow string view used for handling narrow encoded text in UTF-8.
Definition String.hpp:190
RendererGraphicsPipelineFlag
Flags that can be either set by the renderer or by the user to customize the behavior of the graphics...
Definition RendererGraphicsPipeline.hpp:25
std::unordered_map< Key, T, Hash, KeyEqual, ScopedAllocatorAdaptor< StdAllocator< Pair< const Key, T >, RawAllocator > > > HashMap
HashMap is an associative container that contains key-value pairs with unique keys.
Definition Map.hpp:33
struct CeresEngine::GLState state
Flags< RendererGraphicsPipelineFlag > RendererGraphicsPipelineFlags
Flags that can be either set by the renderer or by the user to customize the behavior of the graphics...
Definition Forward.hpp:39
sfl::small_vector< T, N, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > SmallVector
SmallVector is a sequence container similar to Vector.
Definition SmallVector.hpp:31
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Graphics pipeline state descriptor structure.
Definition GPUGraphicsPipeline.hpp:694
Primitive topology enumeration.
Definition PrimitiveTopology.hpp:21
@ Triangles
Triangle list, where each set of three vertices represent a single triangle primitive.
Definition PrimitiveTopology.hpp:50
Definition RendererGraphicsPipeline.hpp:184
RendererGraphicsPipeline * rendererGraphicsPipeline
An instance of the renderer graphics pipeline.
Definition RendererGraphicsPipeline.hpp:186
A structure that describes a RendererGraphicsPipeline specialization.
Definition RendererGraphicsPipeline.hpp:33
RendererShaderSpecialization shaderSpecialization
A description of the shader specialization to use.
Definition RendererGraphicsPipeline.hpp:41
GPUGraphicsPipelineState state
A description of the graphics pipeline state.
Definition RendererGraphicsPipeline.hpp:44
SmallVector< VertexDeclaration, 1 > vertexDeclarations
The vertex declarations that matches the rendered mesh.
Definition RendererGraphicsPipeline.hpp:35
PrimitiveTopology primitiveTopology
The primitive topology to be used when rendering.
Definition RendererGraphicsPipeline.hpp:38
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition RendererGraphicsPipeline.hpp:49
A structure that describes a RendererGraphicsPipeline specialization.
Definition RendererShader.hpp:31
Determines how vertices are laid-out on a vertex buffer or a mesh data.
Definition VertexDeclaration.hpp:205