|
Flint Engine
Modular C++20 2D game engine powered by SDL3
|
Base class for GPU graphics pipelines. More...
#include <flint/graphics/pipelines/pipeline-base.h>
Inheritance diagram for Flint::Pipeline:
Collaboration diagram for Flint::Pipeline:Public Member Functions | |
| Pipeline (SDL_GPUDevice *device) | |
Construct a pipeline bound to device. | |
| virtual bool | initialize (Shader *shader, const PipelineConfig &config) |
| Create the underlying SDL GPU graphics pipeline. | |
| void | bind (SDL_GPURenderPass *renderPass) |
| Bind this pipeline to the active render pass. | |
| SDL_GPUGraphicsPipeline * | getPipeline () const |
| Return the raw SDL GPU graphics pipeline handle. | |
| Shader * | getShader () const |
| Return the shader associated with this pipeline. | |
Protected Member Functions | |
| virtual bool | configurePipeline (SDL_GPUGraphicsPipelineCreateInfo &pipelineInfo) |
| Subclass hook to customize the pipeline create-info before submission. | |
| virtual void | cleanup () |
| Release the SDL GPU pipeline object. | |
Protected Attributes | |
| SDL_GPUDevice * | m_device = nullptr |
| SDL_GPUGraphicsPipeline * | m_pipeline = nullptr |
| Shader * | m_shader = nullptr |
Base class for GPU graphics pipelines.
Handles the common pipeline-creation boilerplate (vertex input, rasterizer, blending, color target). Subclasses may override configurePipeline() to supply custom vertex-attribute layouts or additional pipeline state before the SDL pipeline object is created.
Definition at line 42 of file pipeline-base.h.
|
inline |
Construct a pipeline bound to device.
| device | SDL GPU device that will own all resources. |
Definition at line 49 of file pipeline-base.h.
|
inlinevirtual |
Definition at line 55 of file pipeline-base.h.
|
inline |
Bind this pipeline to the active render pass.
| renderPass | Active SDL GPU render pass. |
Definition at line 146 of file pipeline-base.h.
|
inlineprotectedvirtual |
Release the SDL GPU pipeline object.
Reimplemented in Flint::BatchPipeline, and Flint::UIPipeline.
Definition at line 184 of file pipeline-base.h.
|
inlineprotectedvirtual |
Subclass hook to customize the pipeline create-info before submission.
Called from initialize() just before SDL_CreateGPUGraphicsPipeline(). Override to change the vertex-attribute layout or any other state that PipelineConfig does not expose.
| pipelineInfo | Partially populated create-info struct. |
Reimplemented in Flint::BatchPipeline.
Definition at line 177 of file pipeline-base.h.
|
inline |
Return the raw SDL GPU graphics pipeline handle.
Definition at line 155 of file pipeline-base.h.
|
inline |
Return the shader associated with this pipeline.
Definition at line 162 of file pipeline-base.h.
|
inlinevirtual |
Create the underlying SDL GPU graphics pipeline.
Applies config to build vertex input state, rasterizer state, depth state, and blend state. Calls configurePipeline() to let subclasses inject additional state before pipeline creation.
| shader | Valid Shader with both vertex and fragment stages loaded. |
| config | Pipeline configuration parameters. |
Definition at line 70 of file pipeline-base.h.
|
protected |
Definition at line 191 of file pipeline-base.h.
|
protected |
Definition at line 192 of file pipeline-base.h.
|
protected |
Definition at line 193 of file pipeline-base.h.