Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::geode::GeodeResidentGradientSlot Struct Reference

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 704-byte gradient uniform block (stops inline, donner/gpu/shader/programs/SlugGradientSource.h) and the cached bind group uses the reflected ten-resource gradient pipeline layout with the device-owned dummy clip-mask texture. 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)
 Replace the cached gradient uniform's CPU-byte reservation.
 GeodeResidentGradientSlot (const GeodeResidentGradientSlot &)=delete
GeodeResidentGradientSlot & operator= (const GeodeResidentGradientSlot &)=delete
 GeodeResidentGradientSlot (GeodeResidentGradientSlot &&other) noexcept=default
 Transfer slab handles, cached bindings, and CPU reservations.
GeodeResidentGradientSlot & operator= (GeodeResidentGradientSlot &&other) noexcept
 Release the current slot and take ownership of another gradient slot's resources.
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 (704 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, this device's geometry slab for the document; null until residence is established. Held by shared_ptr so the slab outlives every slot allocated from it, whichever of the two the document lets go of first.
uint64_t allocationOffset = 0
 Whole-slot allocation inside the slab, returned via free on reset.
uint64_t allocationSize = 0
 Number of bytes occupied by this gradient slot's allocation.
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
 Size-based fingerprint of the last uploaded encoded gradient path.
std::vector< uint8_t > lastUniform
 Bytes last written to the uniform region; unchanged draws skip the write.
GeodeGeometryCacheReservation cpuMirrorReservation
 Charged CPU uniform mirror storage.
uint64_t cpuUniformBytes = 0
 Capacity bytes reserved for the cached uniform.

Detailed Description

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 704-byte gradient uniform block (stops inline, donner/gpu/shader/programs/SlugGradientSource.h) and the cached bind group uses the reflected ten-resource gradient pipeline layout with the device-owned dummy clip-mask texture. 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.


Class Documentation

◆ donner::geode::GeodeResidentGradientSlot::Region

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

Constructor & Destructor Documentation

◆ GeodeResidentGradientSlot()

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

Transfer slab handles, cached bindings, and CPU reservations.

Parameters
otherGradient slot whose resource ownership is transferred.

Member Function Documentation

◆ operator=()

GeodeResidentGradientSlot & donner::geode::GeodeResidentGradientSlot::operator= ( GeodeResidentGradientSlot && other)
inlinenoexcept

Release the current slot and take ownership of another gradient slot's resources.

Parameters
otherSlot whose resources are moved into this one.
Returns
This gradient slot after the transfer.

◆ reserveUniformMirror()

bool donner::geode::GeodeResidentGradientSlot::reserveUniformMirror ( uint64_t bytes)
inline

Replace the cached gradient uniform's CPU-byte reservation.

Parameters
bytesNew uniform mirror capacity in bytes.
Returns
False if the document budget refuses the replacement charge.

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