Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
GeodeDevice.h File Reference

RAII wrapper around a WebGPU device - headless or host-provided. More...

#include <algorithm>
#include <atomic>
#include <cstddef>
#include <deque>
#include <map>
#include <memory>
#include <tuple>
#include <vector>
#include <webgpu/webgpu.hpp>
#include "donner/base/Utils.h"
#include "donner/gpu/Device.h"
#include "donner/svg/renderer/geode/GeodeCounters.h"
#include "donner/svg/renderer/geode/GeodeGpuContext.h"
#include "donner/svg/renderer/geode/GeodeGpuWait.h"
#include "donner/svg/renderer/geode/GeodeWgpuUtil.h"
Include dependency graph for GeodeDevice.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::geode::SnapshotReadbackResources
 Move-only resource set for one GPU snapshot unpremultiply readback: a straight-alpha staging texture, its view, and a map-readable readback buffer. More...
struct  donner::geode::GeodeEmbedConfig
 Configuration for embedding Geode into a host application that already owns a WebGPU device. More...
class  donner::geode::GeodeDevice
 Owns (or wraps) a WebGPU device/queue pair for GPU rendering. More...
struct  donner::geode::GeodeDevice::ReadbackStats
struct  donner::geode::GeodeDevice::SceneBatchBindGroupKey
 Key identifying a scene-batch bind group by its exact buffer bindings: the shared batch uniform allocation, the geometry slab chunk, and the record span. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

constexpr uint32_t donner::geode::AlignReadbackBytesPerRow (uint32_t rowBytes)
 256-align a tightly packed row-byte count per the WebGPU texture-to-buffer copy rules. Shared by the device's readback-buffer sizing and the renderer's map-range math; the two MUST agree, because a mapped-range request larger than the buffer returns null rather than raising an error.

Detailed Description

RAII wrapper around a WebGPU device - headless or host-provided.


Class Documentation

◆ donner::geode::GeodeDevice::ReadbackStats

struct donner::geode::GeodeDevice::ReadbackStats
Class Members
int count = 0
bool deviceLost = false True once this device has been declared lost. Sticky, so every later consume keeps reporting it: a frame that never rendered has no other evidence to carry.
int pollIterations = 0
int timedOutWaitMs = 0 Wall time that wait spent before giving up, in milliseconds.
GpuWaitSite timedOutWaitSite = GpuWaitSite::None Bounded wait that declared that loss, or None.
bool usedTimedWaitAny = false