Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::geode::GeodeGradientPipeline Class Reference

Caches a compiled wgpu::RenderPipeline for the Slug gradient-fill shader plus its bind-group layout. More...

#include "donner/svg/renderer/geode/GeodePipeline.h"

Public Member Functions

 GeodeGradientPipeline (const wgpu::Device &device, wgpu::TextureFormat colorFormat, bool useAlphaCoverageShader=false, uint32_t sampleCount=4)
 Construct a gradient pipeline for the given device and color target format.
 GeodeGradientPipeline (const GeodeGradientPipeline &)=delete
GeodeGradientPipelineoperator= (const GeodeGradientPipeline &)=delete
 GeodeGradientPipeline (GeodeGradientPipeline &&) noexcept=default
 Move constructor.
GeodeGradientPipelineoperator= (GeodeGradientPipeline &&) noexcept=default
 Move assignment operator.
const wgpu::RenderPipeline & pipeline () const
 The compiled render pipeline.
const wgpu::BindGroupLayout & bindGroupLayout () const
 The bind group layout used by the pipeline.
wgpu::TextureFormat colorFormat () const
 Color format the pipeline was built for.

Detailed Description

Caches a compiled wgpu::RenderPipeline for the Slug gradient-fill shader plus its bind-group layout.

Parallel to GeodePipeline but with a larger uniform buffer that carries linear-gradient parameters (pathFromGradient transform, start/end, spread mode, per-stop colors and offsets). The vertex layout, Band / curve storage bindings, and blend state are identical.

Kept as a sibling class instead of a branch inside GeodePipeline to keep the solid-fill pipeline's 128-byte uniform layout untouched, and so radial / sweep gradient pipelines can slot in alongside this one later without churning the solid-fill path.

Constructor & Destructor Documentation

◆ GeodeGradientPipeline()

donner::geode::GeodeGradientPipeline::GeodeGradientPipeline ( const wgpu::Device & device,
wgpu::TextureFormat colorFormat,
bool useAlphaCoverageShader = false,
uint32_t sampleCount = 4 )

Construct a gradient pipeline for the given device and color target format.

Parameters
useAlphaCoverageShaderWhen true, selects the alpha-coverage shader variant.
sampleCountMSAA sample count (1 for alpha-coverage, 4 otherwise).

The documentation for this class was generated from the following file: