Alpha-blended pipeline for rendering UI elements (text, panels, icons).
More...
#include <flint/graphics/pipelines/ui-pipeline.h>
|
|
| UIPipeline (const UIPipeline &)=delete |
| |
|
UIPipeline & | operator= (const UIPipeline &)=delete |
| |
| bool | initialize (SDL_GPUDevice *device, ShaderFormat shaderFormat, SDL_GPUTextureFormat swapchainFormat) |
| | Create the GPU graphics pipeline with alpha blending enabled.
|
| |
| void | cleanup () |
| | Release the pipeline and its shader.
|
| |
| | 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.
|
| |
|
| virtual bool | configurePipeline (SDL_GPUGraphicsPipelineCreateInfo &pipelineInfo) |
| | Subclass hook to customize the pipeline create-info before submission.
|
| |
| SDL_GPUDevice * | m_device = nullptr |
| |
| SDL_GPUGraphicsPipeline * | m_pipeline = nullptr |
| |
| Shader * | m_shader = nullptr |
| |
Alpha-blended pipeline for rendering UI elements (text, panels, icons).
Vertex buffer layout:
- location 0: float2 (xy position, in pixels)
- location 1: float2 (uv texcoord)
Definition at line 36 of file ui-pipeline.h.
◆ buildFragmentUniforms()
| static UIFragmentUniforms Flint::UIPipeline::buildFragmentUniforms |
( |
float | r, |
|
|
float | g, |
|
|
float | b, |
|
|
float | a ) |
|
static |
Build a UIFragmentUniforms value.
- Parameters
-
| r | Red channel in [0, 1]. |
| g | Green channel in [0, 1]. |
| b | Blue channel in [0, 1]. |
| a | Alpha channel in [0, 1]. |
◆ buildVertexUniforms()
| static UIVertexUniforms Flint::UIPipeline::buildVertexUniforms |
( |
float | screenWidth, |
|
|
float | screenHeight, |
|
|
float | offsetX = 0.0f, |
|
|
float | offsetY = 0.0f ) |
|
static |
Build a UIVertexUniforms value.
- Parameters
-
| screenWidth | Render-target width in pixels. |
| screenHeight | Render-target height in pixels. |
| offsetX | Horizontal translation offset (default 0). |
| offsetY | Vertical translation offset (default 0). |
◆ cleanup()
| void Flint::UIPipeline::cleanup |
( |
| ) |
|
|
virtual |
◆ initialize()
| bool Flint::UIPipeline::initialize |
( |
SDL_GPUDevice * | device, |
|
|
ShaderFormat | shaderFormat, |
|
|
SDL_GPUTextureFormat | swapchainFormat ) |
Create the GPU graphics pipeline with alpha blending enabled.
- Parameters
-
| device | SDL GPU device. |
| shaderFormat | Backend shader format (SPIRV, MSL, DXIL). |
| swapchainFormat | Color-target format matching the swap chain. |
- Returns
- true on success.
◆ setFragmentUniforms()
| static void Flint::UIPipeline::setFragmentUniforms |
( |
SDL_GPUCommandBuffer * | commandBuffer, |
|
|
const UIFragmentUniforms & | uniforms ) |
|
static |
Upload fragment uniforms (tint color) to the fragment stage.
- Parameters
-
| commandBuffer | Active command buffer. |
| uniforms | Data to upload. |
◆ setVertexUniforms()
| static void Flint::UIPipeline::setVertexUniforms |
( |
SDL_GPUCommandBuffer * | commandBuffer, |
|
|
const UIVertexUniforms & | uniforms ) |
|
static |
Upload vertex uniforms (screen size and offset) to the vertex stage.
- Parameters
-
| commandBuffer | Active command buffer. |
| uniforms | Data to upload. |
The documentation for this class was generated from the following file: