API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

I

interfaceRenderStats

@codexo/exojs / rendering / stable

Per-frame rendering counters collected by the backend each tick. Expose live performance data for debugging and profiling tools.

15
props
0
methods
0
events
Import
import { RenderStats } from '@codexo/exojs'

Per-frame rendering counters collected by the backend each tick. Expose live performance data for debugging and profiling tools.

Properties15
batches: number
Number of draw batches flushed this frame.
bufferUploadBytes: number
Bytes of buffer data uploaded CPU → GPU this frame (vertex / index / transform-storage writes). Per-frame accumulator.
culledNodes: number
Nodes skipped because they fell outside the view frustum. Two caveats apply to retained subtrees, both by design: - the count is per COLLECT, not per frame. A retained subtree that replays without re-collecting reports nothing here, so a scene whose first frame culls N nodes reports 0 on every steady-state frame that follows and reports N again only when a rebuild re-walks it. Read it as "nodes the last collect discarded", not as "nodes off-screen this frame". - the decision is taken against the cull rectangle retention inflates by 1/16 per side, not the exact view rectangle. A node just outside the view is therefore kept rather than culled - that margin is what lets a small camera move replay instead of re-collect.
downloadBytes: number
Bytes read back GPU → CPU this frame (e.g. mapAsync of a storage buffer, render-texture readback). Practically 0 in the 2D render path today; the counter exists so readback paths (screenshots, GPU picking, particle compute) are accounted for when present. Per-frame accumulator.
downloadCount: number
Number of GPU → CPU readback operations issued this frame. Per-frame accumulator.
drawCalls: number
Number of GPU draw calls issued this frame.
frame: number
Monotonically increasing frame index, incremented by resetRenderStats.
frameTimeMs: number
Wall-clock duration of the frame in milliseconds.
gpuFrameTimeMs: null | number
GPU-side duration in milliseconds of the last frame whose hardware timer results have come back, or null when no such result exists yet. Reads null unless RenderBackend.setGpuTimingEnabled has been called and reported a hardware clock; there is no software substitute, so a device without one leaves this null for the whole session. GPU results resolve asynchronously, so this is **not** the frame the other counters describe - it trails them by at least one frame. It is likewise **not** zeroed by resetRenderStats, since the frame it belongs to has already ended by the time the value arrives. What the number covers differs by backend, and the two are not directly comparable: WebGL2 brackets the frame's whole GL command stream (uploads included), while WebGPU sums the execution of the frame's render passes and therefore excludes queue-side uploads.
gpuMemoryBytes: number
Estimated bytes of live GPU memory: the sum over all resident textures (width · height · bytesPerPixel, including mip chains) plus all resident GPU buffers (byteLength). The GPU exposes no VRAM query, so the engine books every allocation and free itself; this is an upper-bound estimate of the engine-owned footprint, not a driver figure. Unlike the other counters this is a **running total**, not a per-frame accumulator: it is **not** zeroed by resetRenderStats - live resources outlive frames. It rises when textures/buffers are created and falls when they are destroyed.
rawFrameDeltaMs: number
Raw wall-clock delta between this frame and the previous one, in milliseconds. May exceed the clamped simulation delta when the engine's internal MAX_DELTA_MS guard activates (e.g. after a debugger pause or device sleep/resume). Use this for profiling to distinguish actual elapsed time from the clamped simulation delta passed to update recipients.
renderPasses: number
Number of render passes executed this frame.
renderTargetChanges: number
Number of render-target switches this frame.
submittedNodes: number
Total scene nodes submitted for rendering before culling. Always nodes, never GPU instances: a node whose renderer expands it into many instances - a tile chunk, a nine-slice, a repeating sprite, a text run - counts once, and reads the same whether the frame was drawn live, replayed entry by entry, or replayed from a recorded retained batch.
textureUploadBytes: number
Bytes of content-texture pixel data uploaded CPU → GPU this frame (texSubImage2D / texImage2D pixel uploads on WebGL2; writeTexture on WebGPU). Per-frame accumulator; a static frame that re-uploads nothing reports 0.
Source