Steady-state resource-creation and submission counts for a single frame. More...
#include "donner/svg/renderer/geode/GeodeCounters.h"
Public Member Functions | |
| void | add (const GeodeCounters &other) |
| Include the completed work of a nested renderer in its owning frame. | |
| void | reset () |
| Reset all counters to zero. Called at RendererGeode::beginFrame. | |
Public Attributes | |
| uint64_t | bufferCreates = 0 |
| gpu::Device::createBuffer calls. Steady-state target with the cross-frame buffer pool: == 0 on an unchanged-geometry frame. | |
| uint64_t | bindgroupCreates = 0 |
| gpu::Device::createBindGroup calls. Steady-state target: <= number_of_pipelines per frame (one bind group per pipeline layout, dynamic offsets for per-draw uniforms). | |
| uint64_t | textureCreates = 0 |
| gpu::Device::createTexture calls (render targets, layer / filter / mask scratch, blend snapshots). Steady-state target with render-target reuse and the transient texture pool: == 0 on repeat-render at the same size. | |
| uint64_t | unclosedLayerScopes = 0 |
| Isolated layers retired without a matching pop in this beginFrame-to-endFrame window. Cleanup during beginFrame counts scopes left by the preceding unfinished frame; endFrame adds any scopes left by the current frame. | |
| uint64_t | unclosedFilterScopes = 0 |
| Filter layers retired without a matching pop at a frame boundary. | |
| uint64_t | unclosedMaskScopes = 0 |
| Masks retired without a matching pop at a frame boundary. | |
| uint64_t | submits = 0 |
| gpu::Device::submit calls. Steady-state target with the frame's command buffers submitted together: one per renderer pass regardless of layer / filter / mask push depth. The owning frame includes each of its offscreen passes. A frame that reaches the most command buffers one submission carries, or that a memory-limited filter budget forces to submit mid-frame, costs more than one. | |
| uint64_t | commandBuffers = 0 |
| Command buffers those submissions carried. A frame records through several independently finished command buffers - one per encoder the renderer closes, plus one per filter chunk that reaches the bound on command-buffer size - and submits them together, so this grows with how finely a frame is split while submits stays flat until the frame reaches the bound on one submission. | |
| uint64_t | pathEncodes = 0 |
| GeodePathEncoder::encode calls (CPU-side path → bands). Steady- state target with the path-encode cache: == 0 on an unchanged- geometry frame (the GeodePathCacheComponent serves all paths). | |
| uint64_t | gradientStopConversions = 0 |
| Gradient stops converted into draw parameters this frame. Each gradient draw converts its stops only after the frame's stop budget admits them, so this never exceeds that budget's charge, and a frame the budget refused converts no more. | |
| uint64_t | gradientStopBytesHashed = 0 |
| Bytes of gradient stops the encoder hashed this frame to find the stop ramp of a gradient with more stops than a draw carries inline. A resolved gradient's draws in one encoder share one lookup, so this stays within one hash per charged gradient and encoder, whatever the number of draws. | |
| uint64_t | gradientStopBytesCompared = 0 |
| Bytes of gradient stops the encoder compared with candidate stop ramps this frame, at most a few comparisons per lookup. | |
| uint64_t | drawCalls = 0 |
| gpu::RenderPassEncoder::draw / drawIndexed calls. One per submitted draw call, regardless of instance count. Used to gate <use> instancing: same-source-entity <use> draws collapse to a single instanced call, so heavy <use> fixtures should drop proportionally. | |
| uint64_t | pipelineSwitches = 0 |
| gpu::RenderPassEncoder::setPipeline calls that actually switched the bound pipeline (the GeoEncoder state tracker deduplicates no-op binds). Gates the "sort / collapse contiguous
same-pipeline draws" work: on a pure-solid fixture the steady-state value should converge toward the number of distinct pipelines the frame touches (typically 1 for Lion- style many-solid-fill input). | |
| uint64_t | sameSourceDrawPairs = 0 |
| Number of consecutive drawPath calls whose source entity matches the immediately previous call's source entity - i.e. the draw-call savings that would be unlocked by <use> instancing. A run of N consecutive same-source draws contributes N - 1 here. | |
| uint64_t | bufferWrites = 0 |
| gpu::Device::writeBuffer calls. Together with bufferWriteBytes this measures the CPU -> GPU buffer-upload traffic of a frame. Steady-state today: one write per arena region per draw (vertex, bands, curves, vBands, vCurves, hGrid, vGrid, uniforms), because cached EncodedPath data has no persistent GPU residence and is re-uploaded every frame. | |
| uint64_t | bufferWriteBytes = 0 |
| Total payload bytes passed to gpu::Device::writeBuffer. The per-frame GPU transfer volume for buffer data. An unchanged- geometry frame should converge toward 0 once encoded path data gains persistent GPU residence. | |
| uint64_t | textureWriteBytes = 0 |
| Total payload bytes passed to gpu::Device::writeTexture (image decode uploads, gradient ramps, filter LUTs, dummy textures). Steady-state target: 0 on an unchanged frame (texture uploads are already cached; this counter verifies that claim). | |
| uint64_t | strokeOutlineFlattens = 0 |
| Path::strokeToFill calls that actually rebuilt a stroke outline this frame (cache hits do not count). Zero on an unchanged-geometry, unchanged-zoom frame; one per stroked draw whose stroke params or device-scale bucket changed. | |
| uint64_t | strokeOutlinePoints = 0 |
| Total point count across the stroke outlines rebuilt this frame. | |
| uint64_t | textStrokeBoundsTests = 0 |
| Text stroke outline bounds tested against an open group's bounds while grouping a text chunk's strokes into shapes: fewer than two for each outline, however the glyphs overlap. | |
| uint64_t | clipPolygonIntersections = 0 |
| Convex polygon intersections the clip stack performed this frame. Each pushed clip folds its polygon into the one cached on the entry below it, so this is at most one per pushed clip whatever the stack depth, and popping a clip, or reapplying the clip state, performs none. | |
| uint64_t | glyphResidencyHits = 0 |
| Glyph occurrences this frame that resolved to an already-cached glyph outline. A text run repeats a handful of outlines across many occurrences, so this is the direct measure of the glyph cache doing its job: on an unchanged frame it equals the run's total non-.notdef glyph count. Counted at the cache lookup, so an occurrence whose font has no vector outline for it counts too - the lookup is what the cache saved. | |
| uint64_t | glyphResidencyUploads = 0 |
| Glyph outlines fetched from the font backend and cached this frame, including the encode and the GPU upload for the ones that have geometry. Steady-state target: == 0 once a document's glyph set is cached; nonzero only on the first frame, after an eviction, or when a font or scale change mints new glyph identities. | |
| uint64_t | glyphResidencyEvictions = 0 |
| Cached glyph outlines dropped this frame to stay inside the residency budget. Steady-state target: == 0; sustained nonzero means the working set does not fit and every frame repays the upload. | |
Steady-state resource-creation and submission counts for a single frame.
Populated by GeoEncoder and RendererGeode at their per-frame resource creation and submission sites. Reset at the start of every RendererGeode::beginFrame.
Invariant: any counter exposed here reflects work done during the previous frame's beginFrame → endFrame window. Counters do not wrap around; they are uint64_t and monotonic within a frame.
|
inline |
Include the completed work of a nested renderer in its owning frame.
| other | Counters from the nested frame, including any of its own nested work. |
| uint64_t donner::geode::GeodeCounters::sameSourceDrawPairs = 0 |
Number of consecutive drawPath calls whose source entity matches the immediately previous call's source entity - i.e. the draw-call savings that would be unlocked by <use> instancing. A run of N consecutive same-source draws contributes N - 1 here.
Zero on fixtures without <use> (Lion, Tiger). Non-zero on fixtures where <use> elements reference the same source in adjacent draw order, which is what the future instancing pass will collapse into one GPU draw call per group.
| uint64_t donner::geode::GeodeCounters::strokeOutlinePoints = 0 |
Total point count across the stroke outlines rebuilt this frame.
The stroke pipeline flattens curves with a tolerance derived from the draw-time device transform (see GeodeStrokeTolerance.h), so this count grows with the view scale. That makes it the observable signal that the flattening tracked the device scale: scale-blind flattening yields the same point count at 1x and at 32x, which is exactly the defect that makes zoomed-in curves render as visible polygons.