Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::geode::GeodeSnapshotReadbackPipeline Class Reference

Compute pipeline for GPU-side snapshot unpremultiplication. More...

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

Public Member Functions

 GeodeSnapshotReadbackPipeline (gpu::Device &device)
 Create the snapshot-unpremultiply compute pipeline for the given device.
 GeodeSnapshotReadbackPipeline (const GeodeSnapshotReadbackPipeline &)=delete
GeodeSnapshotReadbackPipelineoperator= (const GeodeSnapshotReadbackPipeline &)=delete
 GeodeSnapshotReadbackPipeline (GeodeSnapshotReadbackPipeline &&) noexcept=default
GeodeSnapshotReadbackPipelineoperator= (GeodeSnapshotReadbackPipeline &&) noexcept=default
bool valid () const
 True when the bind group layout and compute pipeline were created.
const gpu::ComputePipelinepipeline () const
 The compute pipeline.
const gpu::BindGroupLayoutbindGroupLayout () const
 The bind group layout used by the pipeline.

Detailed Description

Compute pipeline for GPU-side snapshot unpremultiplication.

Reads a premultiplied-alpha render target (binding 0, texture_2d<f32>) and writes straight-alpha RGBA8 into the storage texture at binding 1 (rgba8unorm, write-only). Owned lazily by GeodeDevice so every snapshot sharing the device reuses one compiled pipeline (issue #575: wgpu-native retains compiled pipelines).

The stored bytes replicate the CPU round-half-up reference formula in RendererGeode::ReadGeodeTextureSnapshot exactly, so snapshots produced through this pipeline are byte-identical to the CPU readback path.

Constructor & Destructor Documentation

◆ GeodeSnapshotReadbackPipeline()

donner::geode::GeodeSnapshotReadbackPipeline::GeodeSnapshotReadbackPipeline ( gpu::Device & device)
explicit

Create the snapshot-unpremultiply compute pipeline for the given device.

Create the snapshot-unpremultiply compute pipeline on device from the shader IR program.

Parameters
deviceRuntime device the pipeline and its layouts are created on.

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