Live document geometry retained outside the frame-local arena.
More...
#include "donner/svg/renderer/geode/GeodeResourceBudget.h"
|
| struct | Limits |
| | Caller-selected cache and GPU residency ceilings. More...
|
|
| | GeodeDocumentGeometryBudget (std::shared_ptr< svg::components::DocumentResourceFamilyBudget > family=nullptr) |
| | Create a document geometry budget with an optional shared resource-family budget.
|
|
| GeodeDocumentGeometryBudget (const GeodeDocumentGeometryBudget &)=delete |
|
GeodeDocumentGeometryBudget & | operator= (const GeodeDocumentGeometryBudget &)=delete |
| bool | replaceCacheBytes (std::uint64_t previous, std::uint64_t replacement) |
| | Replace a caller's charged cache bytes, releasing or reserving the difference.
|
| void | releaseCacheBytes (std::uint64_t bytes) |
| | Release up to the specified cache bytes from this document's aggregate charge.
|
| bool | reserveResidentBytes (std::uint64_t bytes) |
| | Charges bytes of GPU residence, the chunks of every device's slabs for this document, unless that would take the document past its resident limit.
|
| void | releaseResidentBytes (std::uint64_t bytes) |
| | Release up to the specified GPU resident bytes from the aggregate charge.
|
| void | setLimitsForTesting (Limits limits) |
| | Tighten cache and resident limits for a test; production limits cannot be raised.
|
|
std::uint64_t | cacheBytes () const |
| | Cache geometry bytes currently charged to this document.
|
|
std::uint64_t | residentBytes () const |
| | GPU resident geometry, record, and uniform buffer bytes currently charged to this document.
|
|
bool | rejected () const |
| | Whether a cache or resident request has ever been refused.
|
|
|
static constexpr std::uint64_t | kMaximumCacheBytes = 64u << 20 |
| | Maximum geometry cache bytes retained by one document.
|
|
static constexpr std::uint64_t | kMaximumResidentBytes = 64u << 20 |
| | Maximum GPU resident geometry, record, and uniform buffer bytes retained by one document.
|
Live document geometry retained outside the frame-local arena.
◆ donner::geode::GeodeDocumentGeometryBudget::Limits
| struct donner::geode::GeodeDocumentGeometryBudget::Limits |
Caller-selected cache and GPU residency ceilings.
◆ GeodeDocumentGeometryBudget()
Create a document geometry budget with an optional shared resource-family budget.
- Parameters
-
| family | Shared document budget, or null for local accounting only. |
◆ releaseCacheBytes()
| void donner::geode::GeodeDocumentGeometryBudget::releaseCacheBytes |
( |
std::uint64_t | bytes | ) |
|
|
inline |
Release up to the specified cache bytes from this document's aggregate charge.
- Parameters
-
| bytes | Cache bytes to release. |
◆ releaseResidentBytes()
| void donner::geode::GeodeDocumentGeometryBudget::releaseResidentBytes |
( |
std::uint64_t | bytes | ) |
|
|
inline |
Release up to the specified GPU resident bytes from the aggregate charge.
- Parameters
-
| bytes | Resident bytes to release. |
◆ replaceCacheBytes()
| bool donner::geode::GeodeDocumentGeometryBudget::replaceCacheBytes |
( |
std::uint64_t | previous, |
|
|
std::uint64_t | replacement ) |
|
inlinenodiscard |
Replace a caller's charged cache bytes, releasing or reserving the difference.
- Parameters
-
| previous | Bytes the caller previously charged, clamped to the aggregate charge. |
| replacement | Bytes the caller wants charged now. |
- Returns
- False when growth is requested after a latched rejection or exceeds a resource limit.
◆ reserveResidentBytes()
| bool donner::geode::GeodeDocumentGeometryBudget::reserveResidentBytes |
( |
std::uint64_t | bytes | ) |
|
|
inlinenodiscard |
Charges bytes of GPU residence, the chunks of every device's slabs for this document, unless that would take the document past its resident limit.
Residence is a cache the renderer can do without: a refused chunk leaves its geometry on the per-frame upload path. So each request is judged on the bytes charged at that moment, and a refusal does not refuse later requests: once a device's residence is released, another device can become resident again. rejected still reports that a request was refused.
- Parameters
-
- Returns
- Whether they were charged.
◆ setLimitsForTesting()
| void donner::geode::GeodeDocumentGeometryBudget::setLimitsForTesting |
( |
Limits | limits | ) |
|
|
inline |
Tighten cache and resident limits for a test; production limits cannot be raised.
- Parameters
-
| limits | Requested upper bounds for both document charges. |
The documentation for this class was generated from the following file: