evan 2026.1.4
Evan
Loading...
Searching...
No Matches
evan::FrameStats Struct Reference

Per-frame instrumentation data (CPU phases and counters). More...

#include <headers/evan/FrameStats.hpp>

Collaboration diagram for evan::FrameStats:

Public Member Functions

ScopedTimer timer (PhaseStats &phase) noexcept
 Creates a scoped timer for phase.
 
void resetWindow () noexcept
 Starts a new report window.
 

Public Attributes

bool enabled = false
 Whether CPU timers and the interval log are active.
 
bool gpuAvailable = false
 Whether GPU timestamp queries were created and are readable.
 
PhaseStats transferFlush
 Renderer::drawFrame: upload flush.
 
PhaseStats preprocess
 OpenXR frame preprocess.
 
PhaseStats inFlightWait
 Slot-reuse fence wait.
 
PhaseStats acquire
 Swapchain image acquire (all sets).
 
PhaseStats updateUniform
 Per-view uniform buffer updates.
 
PhaseStats record
 Per-view command recording.
 
PhaseStats submit
 Per-view queue submissions.
 
PhaseStats renderWait
 OpenXR end-of-frame fence wait.
 
PhaseStats present
 Present/composition (all sets).
 
PhaseStats postprocess
 OpenXR frame postprocess.
 
std::array< PhaseStats, MAX_SWAPCHAINS > updateUniformView
 updateUniform, per view slot.
 
std::array< PhaseStats, MAX_SWAPCHAINS > recordView
 record, per view slot.
 
std::array< PhaseStats, MAX_SWAPCHAINS > submitView
 submit, per view slot.
 
std::array< PhaseStats, MAX_SWAPCHAINS > gpuPass
 GPU pass time, per view slot.
 
uint64_t frames = 0
 Frames in the window.
 
uint64_t totalMeshes = 0
 Meshes registered at draw time.
 
uint64_t visibleMeshes = 0
 Meshes surviving culling.
 
uint64_t culledMeshes = 0
 Meshes removed by culling.
 
uint64_t skippedMeshes = 0
 Meshes skipped (bad state).
 
uint64_t drawCalls = 0
 vkCmdDrawIndexed(Indirect) count.
 
uint64_t instancedDraws = 0
 Draws with instanceCount > 1.
 
uint64_t pipelineBinds = 0
 vkCmdBindPipeline count.
 
uint64_t descriptorBinds = 0
 vkCmdBindDescriptorSets count.
 
uint64_t syncCalls = 0
 RessourceManager::sync() calls.
 
uint64_t syncSkips = 0
 sync() calls short-circuited.
 
uint64_t meshCreations = 0
 GPUMesh constructions.
 
uint64_t meshDestructions = 0
 GPUMesh destructions.
 
uint64_t uploadWaits = 0
 Blocking upload fence waits.
 

Detailed Description

Per-frame instrumentation data (CPU phases and counters).

Disabled by default: enabled mirrors the EVAN_STATS environment variable and every hook collapses to one branch when it is false. When enabled, samples and counters accumulate in fixed-size members (no heap traffic on the hot path) until the report window is flushed by the renderer (one aggregated log record every EVAN_STATS_INTERVAL frames).

Definition at line 135 of file FrameStats.hpp.

Member Function Documentation

◆ resetWindow()

void evan::FrameStats::resetWindow ( )
noexcept

Starts a new report window.

Clears every phase window and counter; keeps enabled and gpuAvailable.

Here is the caller graph for this function:

◆ timer()

ScopedTimer evan::FrameStats::timer ( PhaseStats &  phase)
inlinenoexcept

Creates a scoped timer for phase.

Parameters
phaseThe phase to accumulate into.
Returns
A disabled timer when statistics are off, an active one otherwise.

Definition at line 195 of file FrameStats.hpp.

Member Data Documentation

◆ acquire

PhaseStats evan::FrameStats::acquire

Swapchain image acquire (all sets).

Definition at line 154 of file FrameStats.hpp.

◆ culledMeshes

uint64_t evan::FrameStats::culledMeshes = 0

Meshes removed by culling.

Definition at line 176 of file FrameStats.hpp.

◆ descriptorBinds

uint64_t evan::FrameStats::descriptorBinds = 0

vkCmdBindDescriptorSets count.

Definition at line 181 of file FrameStats.hpp.

◆ drawCalls

uint64_t evan::FrameStats::drawCalls = 0

vkCmdDrawIndexed(Indirect) count.

Definition at line 178 of file FrameStats.hpp.

◆ enabled

bool evan::FrameStats::enabled = false

Whether CPU timers and the interval log are active.

Definition at line 139 of file FrameStats.hpp.

◆ frames

uint64_t evan::FrameStats::frames = 0

Frames in the window.

Definition at line 173 of file FrameStats.hpp.

◆ gpuAvailable

bool evan::FrameStats::gpuAvailable = false

Whether GPU timestamp queries were created and are readable.

False when EVAN_STATS_GPU is off or the device does not support timestamp queries; the report then prints the GPU columns as unavailable.

Definition at line 148 of file FrameStats.hpp.

◆ gpuPass

std::array<PhaseStats, MAX_SWAPCHAINS> evan::FrameStats::gpuPass

GPU pass time, per view slot.

Definition at line 170 of file FrameStats.hpp.

◆ inFlightWait

PhaseStats evan::FrameStats::inFlightWait

Slot-reuse fence wait.

Definition at line 153 of file FrameStats.hpp.

◆ instancedDraws

uint64_t evan::FrameStats::instancedDraws = 0

Draws with instanceCount > 1.

Definition at line 179 of file FrameStats.hpp.

◆ meshCreations

uint64_t evan::FrameStats::meshCreations = 0

GPUMesh constructions.

Definition at line 184 of file FrameStats.hpp.

◆ meshDestructions

uint64_t evan::FrameStats::meshDestructions = 0

GPUMesh destructions.

Definition at line 185 of file FrameStats.hpp.

◆ pipelineBinds

uint64_t evan::FrameStats::pipelineBinds = 0

vkCmdBindPipeline count.

Definition at line 180 of file FrameStats.hpp.

◆ postprocess

PhaseStats evan::FrameStats::postprocess

OpenXR frame postprocess.

Definition at line 160 of file FrameStats.hpp.

◆ preprocess

PhaseStats evan::FrameStats::preprocess

OpenXR frame preprocess.

Definition at line 152 of file FrameStats.hpp.

◆ present

PhaseStats evan::FrameStats::present

Present/composition (all sets).

Definition at line 159 of file FrameStats.hpp.

◆ record

PhaseStats evan::FrameStats::record

Per-view command recording.

Definition at line 156 of file FrameStats.hpp.

◆ recordView

std::array<PhaseStats, MAX_SWAPCHAINS> evan::FrameStats::recordView

record, per view slot.

Definition at line 166 of file FrameStats.hpp.

◆ renderWait

PhaseStats evan::FrameStats::renderWait

OpenXR end-of-frame fence wait.

Definition at line 158 of file FrameStats.hpp.

◆ skippedMeshes

uint64_t evan::FrameStats::skippedMeshes = 0

Meshes skipped (bad state).

Definition at line 177 of file FrameStats.hpp.

◆ submit

PhaseStats evan::FrameStats::submit

Per-view queue submissions.

Definition at line 157 of file FrameStats.hpp.

◆ submitView

std::array<PhaseStats, MAX_SWAPCHAINS> evan::FrameStats::submitView

submit, per view slot.

Definition at line 168 of file FrameStats.hpp.

◆ syncCalls

uint64_t evan::FrameStats::syncCalls = 0

RessourceManager::sync() calls.

Definition at line 182 of file FrameStats.hpp.

◆ syncSkips

uint64_t evan::FrameStats::syncSkips = 0

sync() calls short-circuited.

Definition at line 183 of file FrameStats.hpp.

◆ totalMeshes

uint64_t evan::FrameStats::totalMeshes = 0

Meshes registered at draw time.

Definition at line 174 of file FrameStats.hpp.

◆ transferFlush

PhaseStats evan::FrameStats::transferFlush

Renderer::drawFrame: upload flush.

Definition at line 151 of file FrameStats.hpp.

◆ updateUniform

PhaseStats evan::FrameStats::updateUniform

Per-view uniform buffer updates.

Definition at line 155 of file FrameStats.hpp.

◆ updateUniformView

std::array<PhaseStats, MAX_SWAPCHAINS> evan::FrameStats::updateUniformView

updateUniform, per view slot.

Definition at line 164 of file FrameStats.hpp.

◆ uploadWaits

uint64_t evan::FrameStats::uploadWaits = 0

Blocking upload fence waits.

Definition at line 186 of file FrameStats.hpp.

◆ visibleMeshes

uint64_t evan::FrameStats::visibleMeshes = 0

Meshes surviving culling.

Definition at line 175 of file FrameStats.hpp.


The documentation for this struct was generated from the following file: