|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
Steady-state resource-creation and submission counts for a single frame. More...
#include "donner/svg/renderer/geode/GeodeCounters.h"
Public Member Functions | |
| void | reset () |
| Reset all counters to zero. Called at RendererGeode::beginFrame. | |
Public Attributes | |
| uint64_t | bufferCreates = 0 |
| wgpu::Device::createBuffer calls. Steady-state target with the cross-frame buffer pool: == 0 on an unchanged-geometry frame. | |
| uint64_t | bindgroupCreates = 0 |
| wgpu::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 |
| wgpu::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 | submits = 0 |
| wgpu::Queue::submit calls. Steady-state target with the shared CommandEncoder: == 1 per frame regardless of layer/filter/mask push depth. | |
| 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 | drawCalls = 0 |
| wgpu::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 |
| wgpu::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 |
| wgpu::Queue::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 wgpu::Queue::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 wgpu::Queue::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 | 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.
| 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.