Support Forum G3D Web Page |
Measures execution time of CPU and GPU events across multiple threads. More...
Classes | |
class | Event |
May have child Events. More... | |
Static Public Member Functions | |
static void | beginEvent (const String &name, const String &file, int line, const String &hint="") |
Calls to beginEvent may be nested on a single thread. More... | |
static bool | enabled () |
When disabled no profiling occurs (i.e., beginCPU and beginGFX do nothing). More... | |
static void | endEvent () |
Ends the most recent pending event on the current thread. More... | |
static void | getEvents (Array< const Array< Event > *> &eventTrees) |
Return all events from the previous frame, one array per thread. More... | |
static void | getEventTime (const String &eventName, RealTime &cpuTime, RealTime &gfxTime) |
Returns the sum of all time spent in events with this name (which may be zero, if they do not exist) across all threads. More... | |
static bool | LAUNCH_SHADER_timingEnabled () |
Whether to make profile events in every LAUNCH_SHADER call. More... | |
static void | nextFrame () |
Notify the profiler to latch the current event tree. More... | |
static void | set_LAUNCH_SHADER_timingEnabled (bool enabled) |
Set whether to make profile events in every LAUNCH_SHADER call. More... | |
static void | setEnabled (bool e) |
When disabled no profiling occurs (i.e., beginCPU and beginGFX do nothing). More... | |
static void | threadShutdownHook () |
Do not call directly if using Thread. More... | |
Measures execution time of CPU and GPU events across multiple threads.
|
static |
Calls to beginEvent may be nested on a single thread.
Events on different threads are tracked independently.
|
inlinestatic |
When disabled no profiling occurs (i.e., beginCPU and beginGFX do nothing).
Since profiling can affect performance (nextFrame() may block), top framerate should be measured with profiling disabled.
|
static |
Ends the most recent pending event on the current thread.
Return all events from the previous frame, one array per thread.
The underlying arrays will be mutated when nextFrame() is invoked.
The result has the form: const Profiler::Event& e = (*(eventTrees[threadIndex]))[eventIndex]
The events are stored as the depth-first traversal of the event tree. See the Profiler::Event documentation for information about identifying the roots and edges within each tree.
|
static |
Returns the sum of all time spent in events with this name (which may be zero, if they do not exist) across all threads.
|
static |
Whether to make profile events in every LAUNCH_SHADER call.
Default is true.
|
static |
Notify the profiler to latch the current event tree.
Events are always presented one frame late so that that information is static and independent of when the caller requests it within the frame.
Invoking nextFrame may stall the GPU and CPU by blocking in the method, causing your net frame time to appear to increase. This is (correctly) not reflected in the values returned by event timers.
GApp calls this automatically. Note that this may cause OpenGL errors and race conditions in programs that use multiple GL contexts if there are any outstanding events on any thread at the time that it is invoked. It is the programmer's responsibility to ensure that that does not happen.
|
static |
Set whether to make profile events in every LAUNCH_SHADER call.
Useful for when you only want to time a small amount of thing, or just the aggregate of many launches.
|
static |
When disabled no profiling occurs (i.e., beginCPU and beginGFX do nothing).
Since profiling can affect performance (nextFrame() may block), top framerate should be measured with profiling disabled.
|
static |
Do not call directly if using Thread.
Registered with Thread to deallocate the ThreadInfo for a thread. Must be explicitly invoked if you use a different thread API.