Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
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 on device from the precompiled artifact.
 GeodeSnapshotReadbackPipeline (const GeodeSnapshotReadbackPipeline &)=delete
GeodeSnapshotReadbackPipeline & operator= (const GeodeSnapshotReadbackPipeline &)=delete
 GeodeSnapshotReadbackPipeline (GeodeSnapshotReadbackPipeline &&other) noexcept=default
 Construct by moving another instance's state.
GeodeSnapshotReadbackPipeline & operator= (GeodeSnapshotReadbackPipeline &&other) noexcept=default
 Replace this object's state by moving another instance.
bool valid () const
 True when the bind group layout and compute pipeline were created.
const gpu::ComputePipeline & pipeline () const
 The compute pipeline.
const gpu::BindGroupLayout & bindGroupLayout () const
 The bind group layout used by the pipeline.
uint32_t inputBinding () const
 Reflected binding of the premultiplied source texture.
uint32_t outputBinding () const
 Reflected binding of the straight-alpha storage destination.
gpu::WorkgroupSize workgroupSize () const
 Workgroup shape the entry point declares.

Detailed Description

Compute pipeline for GPU-side snapshot unpremultiplication.

Reads a premultiplied-alpha render target (texture_2d<f32>) and writes straight-alpha RGBA8 into a write-only rgba8unorm storage texture; both binding slots and the workgroup shape come from the precompiled artifact's reflected interface. 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() [1/2]

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

Create the snapshot-unpremultiply compute pipeline on device from the precompiled artifact.

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

◆ GeodeSnapshotReadbackPipeline() [2/2]

donner::geode::GeodeSnapshotReadbackPipeline::GeodeSnapshotReadbackPipeline ( GeodeSnapshotReadbackPipeline && other)
defaultnoexcept

Construct by moving another instance's state.

Parameters
otherSource object.

Member Function Documentation

◆ operator=()

GeodeSnapshotReadbackPipeline & donner::geode::GeodeSnapshotReadbackPipeline::operator= ( GeodeSnapshotReadbackPipeline && other)
defaultnoexcept

Replace this object's state by moving another instance.

Parameters
otherSource object.
Returns
This object after the move.

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