|
| void | replaceRamp (std::shared_ptr< const GeodeGradientRamp > newRamp, gpu::BindGroup newBindGroup) |
| | Replace ramp and rampBindGroup, parking the old ones in the slab until the next frame boundary.
|
| 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.
|
|
|
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 gradient bind group. All bindings reference stable objects (this slot's buffer sub-ranges, boundClipMaskView, and the device-owned placeholder stop-ramp texture), so it survives frames and encoders. A gradient with more stops than the uniform carries inline binds rampBindGroup instead.
|
|
gpu::TextureViewRef | boundClipMaskView |
| | Clip-mask view both cached groups bind: the active path-clip mask's view, which the renderer keeps across frames, or the device's identity-coverage dummy. A draw under a different mask drops both groups and builds them again.
|
|
std::shared_ptr< const GeodeGradientRamp > | ramp |
| | Stop ramp of the last draw whose gradient had more stops than the uniform carries inline, and the cached group that binds it with this slot's regions. Both are replaced only when the stops or the geometry change.
|
|
gpu::BindGroup | rampBindGroup |
| | Gradient bind group binding ramp.
|
|
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.
|
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 gradient pipeline layout with the active clip mask's view (or the device-owned placeholder) and the placeholder stop-ramp texture. Residence is not taken while a mask pass is open, exactly like the solid-fill residence gate; a draw under a clip polygon stays resident, its uniform carrying the polygon's planes.