|
Flint Engine
Modular C++20 2D game engine powered by SDL3
|
Graphics pipeline for primary 2D batched quad geometry and procedural shapes. More...
#include <flint/graphics/pipelines/batch-pipeline.h>
Inheritance diagram for Flint::BatchPipeline:
Collaboration diagram for Flint::BatchPipeline:Public Member Functions | |
| BatchPipeline (const BatchPipeline &)=delete | |
| BatchPipeline & | operator= (const BatchPipeline &)=delete |
| bool | initialize (SDL_GPUDevice *device, ShaderFormat shaderFormat, SDL_GPUTextureFormat swapchainFormat) |
| Initialize the batch pipeline with shader assets and swapchain target formats. | |
| bool | isInitialized () const |
| Check whether the underlying GPU pipeline handle is created and ready. | |
| void | cleanup () |
| Release batch shader resources and reset base pipeline state. | |
Public Member Functions inherited from Flint::Pipeline | |
| 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 | |
| bool | configurePipeline (SDL_GPUGraphicsPipelineCreateInfo &pipelineInfo) override |
| Configure pipeline vertex layout, shader stages, and blend states. | |
Protected Member Functions inherited from Flint::Pipeline | |
Additional Inherited Members | |
Protected Attributes inherited from Flint::Pipeline | |
| SDL_GPUDevice * | m_device = nullptr |
| SDL_GPUGraphicsPipeline * | m_pipeline = nullptr |
| Shader * | m_shader = nullptr |
Graphics pipeline for primary 2D batched quad geometry and procedural shapes.
Manages shader loading, vertex buffer layout configuration (matching BatchVertex), and pipeline creation for textured quads, colored rects, and procedural SDF circles/rings.
Definition at line 23 of file batch-pipeline.h.
|
inlinevirtual |
Release batch shader resources and reset base pipeline state.
Reimplemented from Flint::Pipeline.
Definition at line 56 of file batch-pipeline.h.
|
overrideprotectedvirtual |
Configure pipeline vertex layout, shader stages, and blend states.
Attribute Layout (28-byte stride, matching BatchVertex):
location = 0): Position (FLOAT2, offset 0)location = 1): UV (FLOAT2, offset 8)location = 2): Color (UBYTE4_NORM, offset 16)location = 3): ShapeParams (FLOAT2, offset 20)Blend State: Configures standard non-premultiplied alpha blending for color target attachments:
SRC_ALPHAONE_MINUS_SRC_ALPHAADDONEONE_MINUS_SRC_ALPHAADD| pipelineInfo | Pipeline creation descriptor structure to populate. |
Reimplemented from Flint::Pipeline.
| bool Flint::BatchPipeline::initialize | ( | SDL_GPUDevice * | device, |
| ShaderFormat | shaderFormat, | ||
| SDL_GPUTextureFormat | swapchainFormat ) |
Initialize the batch pipeline with shader assets and swapchain target formats.
Loads the batch vertex/fragment shaders and builds the underlying GPU pipeline with standard alpha blending enabled.
| device | Pointer to the active SDL GPU device. |
| shaderFormat | Active GPU shader format (e.g., SPIR-V, MSL, DXBC). |
| swapchainFormat | Target render pass color format. |
|
inlinenodiscard |
Check whether the underlying GPU pipeline handle is created and ready.
Definition at line 49 of file batch-pipeline.h.