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

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...

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

Public Attributes

uint64_t uniformBufferId = 0
uint64_t uniformOffset = 0
uint64_t uniformSize = 0
uint64_t chunkBufferId = 0
uint64_t chunkBytes = 0
uint64_t recordBufferId = 0
uint64_t recordOffset = 0
uint64_t recordBytes = 0

Friends

bool operator== (const SceneBatchBindGroupKey &a, const SceneBatchBindGroupKey &b)=default
bool operator< (const SceneBatchBindGroupKey &a, const SceneBatchBindGroupKey &b)

Detailed Description

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.

The dummy texture/sampler bindings are device-owned singletons, so they never contribute to the key.

Scene batches bind pooled arena and slab buffers whose identities and offsets are stable across steady-state frames, so a cached bind group keyed this way is reusable frame over frame (keeping the per-frame bind-group create count flat; the GeodePerf ceilings pin this).

Buffers are identified by the process-unique ids handed out by AllocateBufferId(), NOT by their WGPUBuffer handle addresses. A cached bind group keeps the buffer's GPU-side resource alive inside WebGPU, but it does NOT keep the caller's handle object alive: when the document that owned a slab chunk is destroyed, its handles are released and their addresses become available to the allocator again. A device outlives the documents drawn on it (renderers lease devices from a small idle pool), so a later document's freshly created buffer can land on a recycled address and - with identical chunk sizes and record offsets, the norm for small documents - compare EQUAL to an entry left behind by the dead one. The lookup would then hand back the previous document's bind group and the batch would draw that document's records and geometry, which shows up as whole shapes rendered at another document's transform.


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