Support Forum G3D Web Page |
Reports measured GPU performance and throughput. More...
Public Member Functions | |
Stats () | |
void | reset () |
Public Attributes | |
float | frameDuration = 0.0f |
Instantaneous duration in seconds. More... | |
float | frameRate |
Inverse of beginframe->endframe time. More... | |
uint32 | majorOpenGLStateChanges |
uint32 | majorStateChanges |
uint32 | minorOpenGLStateChanges |
uint32 | minorStateChanges |
uint32 | primitives |
Number of individual primitives (e.g., number of triangles) More... | |
uint32 | pushStates |
float | smoothFrameRate |
Exponentially weighted moving average of frame rate. More... | |
double | smoothTriangleRate |
Exponentially weighted moving average of triangleRate. More... | |
double | smoothTriangles |
Exponentially weighted moving average of Stats::triangles. More... | |
RealTime | swapbuffersTime |
Amount of time spent in swapbuffers (when large, indicates that the GPU is blocking the CPU). More... | |
double | triangleRate |
uint32 | triangles |
Number of triangles since last beginFrame() More... | |
Reports measured GPU performance and throughput.
"OpenGL state changes" are those that forced underlying OpenGL state changes; RenderDevice optimizes away redundant state changes so many changes will not affect OpenGL.
Many programs are limited by the number of GL state changes; sorting objects in the render pipeline to minimize this can dramatically increase performance.
Major state changes are texture, shader, camera, and projection changes. These are particularly expensive because they can cause cache misses and pipeline stalls. Graphics cards can handle about 100 of these in real-time. Minor state changes are color, vertex, and test changes. About 2000 of these can be made per frame in real-time.
One way to locate the code that causes state changes is to put breakpoints in RenderDevice::minGLStateChange and RenderDevice::majGLStateChange and look at the call stack.
Zeroed by beginFrame.
G3D::RenderDevice::Stats::Stats | ( | ) |
void G3D::RenderDevice::Stats::reset | ( | ) |
float G3D::RenderDevice::Stats::frameDuration = 0.0f |
Instantaneous duration in seconds.
float G3D::RenderDevice::Stats::frameRate |
Inverse of beginframe->endframe time.
Accounts for the frame timing of the system as a whole, not just graphics.
uint32 G3D::RenderDevice::Stats::majorOpenGLStateChanges |
Referenced by G3D::RenderDevice::majGLStateChange().
uint32 G3D::RenderDevice::Stats::majorStateChanges |
Referenced by G3D::RenderDevice::majStateChange().
uint32 G3D::RenderDevice::Stats::minorOpenGLStateChanges |
Referenced by G3D::RenderDevice::minGLStateChange().
uint32 G3D::RenderDevice::Stats::minorStateChanges |
Referenced by G3D::RenderDevice::minStateChange().
uint32 G3D::RenderDevice::Stats::primitives |
Number of individual primitives (e.g., number of triangles)
uint32 G3D::RenderDevice::Stats::pushStates |
float G3D::RenderDevice::Stats::smoothFrameRate |
Exponentially weighted moving average of frame rate.
double G3D::RenderDevice::Stats::smoothTriangleRate |
Exponentially weighted moving average of triangleRate.
double G3D::RenderDevice::Stats::smoothTriangles |
Exponentially weighted moving average of Stats::triangles.
RealTime G3D::RenderDevice::Stats::swapbuffersTime |
Amount of time spent in swapbuffers (when large, indicates that the GPU is blocking the CPU).
double G3D::RenderDevice::Stats::triangleRate |
uint32 G3D::RenderDevice::Stats::triangles |
Number of triangles since last beginFrame()