#include <RixInterfaces.h>
Inheritance diagram for RixStats:
Public Types | |
typedef void(* | Reporter )(class RixXmlFile *file) |
A reporting function takes a RixXmlFile and writes to it using WriteXml and WriteText. | |
Public Member Functions | |
virtual void | AddTimerStat (float *seconds, const char *name, const char *description)=0 |
Add a timer statistic, which is simply a pointer to a float into which the plugin has accumulated timing information (in seconds). | |
virtual void | AddMemoryStat (size_t *bytes, const char *name, const char *description)=0 |
Add a memory statistic, which is simply a pointer to a size_t into which the plugin has accumulated memory usage information (in bytes). | |
virtual void | AddReporter (Reporter func)=0 |
Register a statistics reporter, which is called at the end of each frame after built-in statistics are reported (if statistics are enabled). | |
virtual int | GetVersion () const |
Get the version number of this interface. | |
Protected Member Functions | |
RixStats () | |
Constructor is for internal use only. | |
Protected Attributes | |
int | m_version |
Version number of this interface. |
Thread safe.
Plugins can report elapsed time and peak memory usage statistics via AddTimerStat and AddMemoryStat. Other user-defined statistics can be reported via AddReporter. If statistics are enabled, plugin statistics are reported at the end of each frame, after the built-in statistics are reported.
Note that shader plugins must take care to ensure thread safety when recording statistics in global variables. Controlling access with a mutex is straightforward. Alternatively, statistics can be recorded in per-thread data and then combined at the end of a frame. See the RSL Plugin application note or the reference documentation for RslContext::SetThreadData for more information.
|
A reporting function takes a RixXmlFile and writes to it using WriteXml and WriteText.
|
|
Constructor is for internal use only.
|
|
Add a memory statistic, which is simply a pointer to a size_t into which the plugin has accumulated memory usage information (in bytes). The name must be a valid XML token; the description may be empty. A duplicate call with the same name as a previously added statistic is ignored (a warning is generated if a different pointer is specified). The name and description are copied. |
|
Register a statistics reporter, which is called at the end of each frame after built-in statistics are reported (if statistics are enabled). Duplicate calls with the same reporter are ignored. Here is an example of a simple reporting function: |
|
Add a timer statistic, which is simply a pointer to a float into which the plugin has accumulated timing information (in seconds). The name must be a valid XML token; the description may be empty. A duplicate call with the same name as a previously added statistic is ignored (a warning is generated if a different pointer is specified). The name and description are copied. |
|
Get the version number of this interface. Different interfaces might have different version numbers in a given release. |
|
Version number of this interface.
|