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

Holds one production device for the whole corpus, because device creation compiles every shared pipeline and is far more expensive than any single scene. More...

#include "donner/gpu/baseline/WgpuBaselineCapture.h"

Public Member Functions

 WgpuBaselineCapturer (const WgpuBaselineCapturer &)=delete
WgpuBaselineCapturer & operator= (const WgpuBaselineCapturer &)=delete
const CaptureEnvironmentenvironment () const
 The adapter this capturer is bound to.
std::string capture (const CorpusScene &scene, std::vector< uint8_t > &pixelsOut)
 Renders one scene and reads its pixels back.

Static Public Member Functions

static std::unique_ptr< WgpuBaselineCapturer > Create ()
 Creates a capturer, or returns null when no GPU adapter is available on this host.

Detailed Description

Holds one production device for the whole corpus, because device creation compiles every shared pipeline and is far more expensive than any single scene.

Member Function Documentation

◆ capture()

std::string donner::gpu::baseline::WgpuBaselineCapturer::capture ( const CorpusScene & scene,
std::vector< uint8_t > & pixelsOut )

Renders one scene and reads its pixels back.

Parameters
sceneScene to render.
pixelsOutReceives tightly packed RGBA8 premultiplied pixels, row-major, kCorpusSize * kCorpusSize * 4 bytes.
Returns
An empty string on success, or a human-readable reason the capture failed.

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