|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
GPU-resident geometry for one gradient-painted fill. Mirrors GeodeResidentSlot: a combined-usage buffer holds the same eight analytic dual-ray SSBO regions, but the uniform region holds the 672-byte gradient uniform block (stops inline, shaders/slug_gradient.wgsl) and the cached bind group uses the 11-binding gradient pipeline layout with the device-owned dummy clip-mask texture/sampler in bindings 3 and 4. Residence is only taken when no clip mask, clip polygon, or mask pass is active (the gradient shader's clip flags must stay zero for the cached bind group to remain stable), exactly like the solid-fill residence gate. More...
#include "donner/svg/renderer/geode/GeodeResidentPathComponent.h"
Classes | |
| struct | Region |
| A byte sub-range of buffer (same semantics as GeodeResidentSlot::Region). More... | |
Public Member Functions | |
| bool | reserveUniformMirror (uint64_t bytes) |
| GeodeResidentGradientSlot (const GeodeResidentGradientSlot &)=delete | |
| GeodeResidentGradientSlot & | operator= (const GeodeResidentGradientSlot &)=delete |
| GeodeResidentGradientSlot (GeodeResidentGradientSlot &&) noexcept=default | |
| GeodeResidentGradientSlot & | operator= (GeodeResidentGradientSlot &&other) noexcept |
| void | reset () |
| Return the slab allocation and drop the bind group + borrowed handle. Never calls Buffer::destroy(); see GeodeResidentSlot::reset. | |
Public Attributes | |
| gpu::BufferRef | buffer |
| Combined Storage|Uniform|CopyDst buffer, borrowed from the owning GeodeResidentSlab chunk; region offsets are ABSOLUTE buffer offsets. Region layout matches GeodeResidentSlot, with the uniform region sized for GradientUniforms (672 bytes). | |
| uint64_t | bufferId = 0 |
| Stable identity of buffer (see GeodeDevice::AllocateBufferId), so returning the allocation matches the owning chunk by identity rather than by a handle address the allocator can recycle. | |
| std::shared_ptr< GeodeResidentSlab > | slab |
| Slab that owns buffer; null until residence is established. Held by shared_ptr so a device change (which swaps the registry's slab) cannot leave a slot referencing a destroyed slab: old slots keep the old slab alive until their own reset drops the reference. | |
| uint64_t | allocationOffset = 0 |
| Whole-slot allocation inside the slab, returned via free on reset. | |
| uint64_t | allocationSize = 0 |
| gpu::BindGroup | bindGroup |
| Cached 11-binding gradient bind group. All bindings reference stable objects (this slot's buffer sub-ranges + device-owned dummy clip-mask texture/sampler), so it survives frames and encoders. | |
| Region | bands |
| Horizontal band SSBO (binding 1). | |
| Region | curves |
| Horizontal curve SSBO (binding 2). | |
| Region | hRefs |
| Horizontal curve-reference SSBO (binding 9). | |
| Region | vBands |
| Vertical band SSBO (binding 5). | |
| Region | vCurves |
| Vertical curve SSBO (binding 6). | |
| Region | vRefs |
| Vertical curve-reference SSBO (binding 10). | |
| Region | hGrid |
| Horizontal band grid (binding 7). | |
| Region | vGrid |
| Vertical band grid (binding 8). | |
| Region | uniform |
| Per-draw gradient uniform block (binding 0, 256-aligned). | |
| uint32_t | vertexCount = 0 |
| Triangle-fan draw count generated from vertex_index. | |
| uint64_t | lastResidentFrame = ~uint64_t{0} |
| Frame index in which this slot was last drawn via the resident path. A slot's single uniform buffer + cached bind group can only serve ONE draw per frame; see GeodeResidentSlot::lastResidentFrame. | |
| uint64_t | owningDeviceId = 0 |
| Process-unique device id of the device that created the resources; see GeodeResidentSlot::owningDeviceId. | |
| bool | resident = false |
| True once buffer + bindGroup hold the current encode. | |
| const void * | encodedKey = nullptr |
| Identity guard: address + cheap fingerprint of the uploaded encode. | |
| uint64_t | encodedFingerprint = 0 |
| std::vector< uint8_t > | lastUniform |
| Bytes last written to the uniform region; unchanged draws skip the write. | |
| GeodeGeometryCacheReservation | cpuMirrorReservation |
| uint64_t | cpuUniformBytes = 0 |
GPU-resident geometry for one gradient-painted fill. Mirrors GeodeResidentSlot: a combined-usage buffer holds the same eight analytic dual-ray SSBO regions, but the uniform region holds the 672-byte gradient uniform block (stops inline, shaders/slug_gradient.wgsl) and the cached bind group uses the 11-binding gradient pipeline layout with the device-owned dummy clip-mask texture/sampler in bindings 3 and 4. Residence is only taken when no clip mask, clip polygon, or mask pass is active (the gradient shader's clip flags must stay zero for the cached bind group to remain stable), exactly like the solid-fill residence gate.
| struct donner::geode::GeodeResidentGradientSlot::Region |
A byte sub-range of buffer (same semantics as GeodeResidentSlot::Region).
| Class Members | ||
|---|---|---|
| uint64_t | offset = 0 | |
| uint64_t | size = 0 | |