|
|
Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
|
Size-and-usage-keyed free list of wgpu buffers. More...
#include "donner/svg/renderer/geode/GeodeBufferPool.h"
Public Member Functions | |
| ScopedWgpuHandle< wgpu::Buffer > | acquire (wgpu::BufferUsage usage, const char *label, uint64_t minCapacity, uint64_t *outCapacity) |
| Acquire a pooled buffer with exactly usage and capacity >= minCapacity. | |
| void | release (ScopedWgpuHandle< wgpu::Buffer > buffer, wgpu::BufferUsage usage, const char *label, uint64_t capacity) |
| Return a buffer to the pool. | |
| size_t | size () const |
| Number of pooled buffers (for tests). | |
| void | clear () |
| Drop every pooled buffer. | |
Size-and-usage-keyed free list of wgpu buffers.
Owned by RendererGeode::Impl (mirrors the M4.2 transient render-target texture pool) and handed to every GeoEncoder the renderer constructs. Not thread-safe; all use is on the renderer's thread.
|
inline |
Acquire a pooled buffer with exactly usage and capacity >= minCapacity.
Preference order: an entry released under the same label (each arena reacquires its own previous, right-sized buffer, so a Slug curve arena never trades buffers with a tiny grid arena of the same usage class), else the smallest usage-compatible entry.
| usage | Required buffer usage flags (exact match). |
| label | Arena debug label (string literal; matched by content). |
| minCapacity | Minimum byte capacity. |
| outCapacity | Set to the returned buffer's capacity on success. |
|
inline |
Return a buffer to the pool.
When the pool is full, the smallest entry (including the incoming buffer) is dropped instead, bounding pooled VRAM while keeping the large arenas that are expensive to re-grow.