Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
Loading...
Searching...
No Matches
donner::geode::GeodeCheckerboardPipeline Class Reference

Caches the compiled wgpu::RenderPipeline for the checkerboard underlay the editor's direct framebuffer presentation draws behind transparent document regions, plus its bind group layout. More...

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

Classes

struct  Uniforms
 Uniform block consumed by the checkerboard shader. More...

Public Member Functions

 GeodeCheckerboardPipeline (const wgpu::Device &device, wgpu::TextureFormat colorFormat)
 Create the checkerboard pipeline for the given device and target format.
 GeodeCheckerboardPipeline (const GeodeCheckerboardPipeline &)=delete
GeodeCheckerboardPipelineoperator= (const GeodeCheckerboardPipeline &)=delete
 GeodeCheckerboardPipeline (GeodeCheckerboardPipeline &&) noexcept=default
 Move constructor.
GeodeCheckerboardPipelineoperator= (GeodeCheckerboardPipeline &&) noexcept=default
 Move assignment operator.
bool valid () const
 True when the shader, bind group layout, and pipeline all compiled.
const wgpu::RenderPipeline & pipeline () const
 The compiled render pipeline.
const wgpu::BindGroupLayout & bindGroupLayout () const
 Bind group layout used by the pipeline.

Detailed Description

Caches the compiled wgpu::RenderPipeline for the checkerboard underlay the editor's direct framebuffer presentation draws behind transparent document regions, plus its bind group layout.

Owned by GeodeDevice (lazily, via GeodeDevice::checkerboardPipeline()) so every consumer sharing the device reuses one compiled pipeline - wgpu-native retains every pipeline ever constructed, so per-consumer construction leaks (issue #575).

Bind group layout:

The pipeline takes no vertex buffer - the shader emits a fullscreen triangle from @builtin(vertex_index). A draw call is pass.draw(3, 1, 0, 0). The caller owns its uniform buffer and bind group; Uniforms pins the layout contract between the two.


Class Documentation

◆ donner::geode::GeodeCheckerboardPipeline::Uniforms

struct donner::geode::GeodeCheckerboardPipeline::Uniforms

Uniform block consumed by the checkerboard shader.

Class Members
float checkerSize Checker cell size in logical pixels.
float darkColor[4] RGBA for odd cells.
float devicePixelRatio Device pixels per logical pixel.
float lightColor[4] RGBA for even cells.
float targetSize[2] Render-target size in device pixels.

Constructor & Destructor Documentation

◆ GeodeCheckerboardPipeline()

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

Create the checkerboard pipeline for the given device and 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 file: