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

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

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

Public Member Functions

 GeodePipeline (const wgpu::Device &device, wgpu::TextureFormat colorFormat)
 Create a Slug fill pipeline for the given device and color target format.
 GeodePipeline (const GeodePipeline &)=delete
GeodePipelineoperator= (const GeodePipeline &)=delete
 GeodePipeline (GeodePipeline &&) noexcept=default
GeodePipelineoperator= (GeodePipeline &&) noexcept=default
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 fill shader, plus its bind group layout.

One GeodePipeline instance is sufficient per (device, render-target-format) pair — the actual data (uniforms, vertex buffers, bands, curves) varies per draw call but the pipeline state object can be reused.

The bind group layout matches the shader in shaders/slug_fill.wgsl:

  • binding 0: uniform buffer (Uniforms struct: mvp, viewport, color, fillRule)
  • binding 1: storage buffer (read-only) — Band[]
  • binding 2: storage buffer (read-only) — curve data (flat f32[])

The vertex buffer layout is:

  • location 0: vec2f position (offset 0)
  • location 1: vec2f normal (offset 8)
  • location 2: u32 bandIndex (offset 16) Stride: 20 bytes per vertex.

Constructor & Destructor Documentation

◆ GeodePipeline()

donner::geode::GeodePipeline::GeodePipeline ( const wgpu::Device & device,
wgpu::TextureFormat colorFormat )

Create a Slug fill pipeline for the given device and color target format.

Parameters
deviceThe WebGPU device.
colorFormatThe pixel format of the render target this pipeline will draw into. Must match the target texture's format at draw time.

The documentation for this class was generated from the following files:
  • donner/svg/renderer/geode/GeodePipeline.h
  • donner/svg/renderer/geode/GeodePipeline.cc