VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Static Public Member Functions | Static Public Attributes
makVrf::DtProfiler Class Reference

Static facade controlling the Tracy performance profiler in VR-Forces.

DtProfiler is the single entry point for turning Tracy profiling on and off, configuring per-module trace levels and callstack capture depth, and exposing the "tracy" console command. The profiling marker macros declared further below (DtPROFILE, DtPROFILELEVEL, DtProfilerFrameMark, ...) consult this class at runtime to decide whether and how each instrumented zone is recorded.

Static Public Member Functions

static void initializeConsoleCommands ()
 
static void setCollectTracyStats (bool b)
 
static void setCollectTracyStatsWithoutStartup (bool b)
 
static void setStartupTracyWithoutCollect (bool b)
 
static bool collectTracyStats ()
 
static int tracyModuleLevel (size_t moduleNameHash)
 
static size_t addExternalModule (const std::string &Module)
 
static void Shutdown ()
 
static unsigned int tracyCallstackDepth ()
 
static void setTracyCallstackDepth (unsigned int depth)
 

Static Public Attributes

static size_t theTerrainModuleName
 
static size_t theVrfUtilModuleName
 
static unsigned int theTracyCallstackDepth
 

Member Function Documentation

static void makVrf::DtProfiler::initializeConsoleCommands ( )
static

Registers the "tracy" console command with the global console command manager.

Call once at start-up so profiling can be controlled from the console, e.g. "tracy enable terrain:2 vrfutil:1".

static void makVrf::DtProfiler::setCollectTracyStats ( bool  b)
static

Enables or disables collection of Tracy profiling statistics.

When enabling, the Tracy profiler is started up first if it is not already running.

Parameters
btrue to begin recording profiling zones, false to stop.
static void makVrf::DtProfiler::setCollectTracyStatsWithoutStartup ( bool  b)
static

Sets the collect-statistics flag without starting up the profiler.

Use when the profiler is already running (or must not be started here) and only the collection flag should change.

Parameters
btrue to mark statistics as being collected, false otherwise.
static void makVrf::DtProfiler::setStartupTracyWithoutCollect ( bool  b)
static

Starts up or shuts down the Tracy profiler without changing the collect-statistics flag.

Lets the Tracy server connection be established (or torn down) ahead of time so collection can later be toggled with no start-up cost.

Parameters
btrue to start up the profiler, false to shut it down.
static bool makVrf::DtProfiler::collectTracyStats ( )
static

Indicates whether Tracy statistics collection is currently active.

Returns
true if profiling zones are being recorded, false otherwise.
static int makVrf::DtProfiler::tracyModuleLevel ( size_t  moduleNameHash)
static

Returns the user-configured trace level for a module.

Modules are identified by the hash of their name (e.g. std::hash<std::string>{}("terrain")). The leveled marker macros compare this value against their own level argument to decide whether to record.

Parameters
moduleNameHashHash of the module name to query.
Returns
The trace level set for the module, or 0 if none has been set.
static size_t makVrf::DtProfiler::addExternalModule ( const std::string &  Module)
static

Registers an external module so it can use the leveled profiling markers.

Intended for customer plug-ins that want their own per-module trace level.

size_t theMyExternalDllModuleName = makVrf::DtProfiler::addExternalModule("MyExternalDll");
DtPROFILELEVEL("MyFunction", theMyExternalDllModuleName, 1)
Parameters
ModuleHuman-readable module name to register.
Returns
The hash key identifying the module, to be passed to the leveled markers.
static void makVrf::DtProfiler::Shutdown ( )
static

Shuts down the Tracy profiler, flushing and releasing its resources.

static unsigned int makVrf::DtProfiler::tracyCallstackDepth ( )
static

Returns the callstack capture depth applied when recording zones.

Returns
Number of stack frames captured per zone; 0 means no callstack capture.
static void makVrf::DtProfiler::setTracyCallstackDepth ( unsigned int  depth)
static

Sets the callstack capture depth applied when recording zones.

Greater depth yields richer call information at a higher runtime cost.

Parameters
depthNumber of stack frames to capture per zone (0 disables capture).

Member Data Documentation

size_t makVrf::DtProfiler::theTerrainModuleName
static

Hash of the "terrain" module name, for use with the leveled markers.

size_t makVrf::DtProfiler::theVrfUtilModuleName
static

Hash of the "vrfutil" module name, for use with the leveled markers.

unsigned int makVrf::DtProfiler::theTracyCallstackDepth
static

Current callstack capture depth applied to recorded zones.

Note
Defaults to 0 (no callstack capture).
See Also
tracyCallstackDepth()
setTracyCallstackDepth()

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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)