Class PerfStats
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Collects per frame rendering statistics.
public class PerfStatsInheritance
object ← PerfStats
Constructors
PerfStats()
Initializes a new PerfStats owned by the current thread until a frame is marked.
public PerfStats()Properties
Allocations
Gets the managed allocation and GC statistics for the same frame. Captured independently of PerfStats.Capture.
public AllocStats Allocations { get; }Property Value
Capture
Gets or sets whether statistics are actively collected this frame.
public bool Capture { get; set; }Property Value
bool
Timings
Gets the CPU and GPU timings for the same frame. Captured independently of PerfStats.Capture.
public Timings Timings { get; }Property Value
Methods
DisplayStats(TextRenderer, Camera, IReadOnlyList<Scene>, LightBinner?, float, float, float)
Renders the collected statistics to screen using the provided text renderer.
public void DisplayStats(TextRenderer textRenderer, Camera camera, IReadOnlyList<Scene> scenes, LightBinner? lightBinner, float x = 0.02, float y = 0.05, float scale = 11)Parameters
textRenderer TextRenderer
Text renderer to use for display.
camera Camera
Camera for positioning text.
scenes IReadOnlyList<Scene>
Every scene drawn, main scene first.
lightBinner LightBinner?
Light binner of the main view, or null before the first frame.
x float
X position (0-1 as fraction of screen width).
y float
Y position (0-1 as fraction of screen height).
scale float
Text scale.
Dispose()
Releases resources.
public void Dispose()MarkFrameBegin()
Resets per-frame counters, reads back the previous frame's results.
public void MarkFrameBegin()MarkFrameEnd()
Ends this frame's counters and timings.
public void MarkFrameEnd()
