Support Forum       G3D Web Page     
Public Member Functions | Public Attributes | List of all members
G3D::RenderDevice::Stats Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Stats()

G3D::RenderDevice::Stats::Stats ( )

Member Function Documentation

◆ reset()

void G3D::RenderDevice::Stats::reset ( )

Member Data Documentation

◆ frameDuration

float G3D::RenderDevice::Stats::frameDuration = 0.0f

Instantaneous duration in seconds.

◆ frameRate

float G3D::RenderDevice::Stats::frameRate

Inverse of beginframe->endframe time.

Accounts for the frame timing of the system as a whole, not just graphics.

◆ majorOpenGLStateChanges

uint32 G3D::RenderDevice::Stats::majorOpenGLStateChanges

◆ majorStateChanges

uint32 G3D::RenderDevice::Stats::majorStateChanges

◆ minorOpenGLStateChanges

uint32 G3D::RenderDevice::Stats::minorOpenGLStateChanges

◆ minorStateChanges

uint32 G3D::RenderDevice::Stats::minorStateChanges

◆ primitives

uint32 G3D::RenderDevice::Stats::primitives

Number of individual primitives (e.g., number of triangles)

◆ pushStates

uint32 G3D::RenderDevice::Stats::pushStates

◆ smoothFrameRate

float G3D::RenderDevice::Stats::smoothFrameRate

Exponentially weighted moving average of frame rate.

◆ smoothTriangleRate

double G3D::RenderDevice::Stats::smoothTriangleRate

Exponentially weighted moving average of triangleRate.

◆ smoothTriangles

double G3D::RenderDevice::Stats::smoothTriangles

Exponentially weighted moving average of Stats::triangles.

◆ swapbuffersTime

RealTime G3D::RenderDevice::Stats::swapbuffersTime

Amount of time spent in swapbuffers (when large, indicates that the GPU is blocking the CPU).

◆ triangleRate

double G3D::RenderDevice::Stats::triangleRate

◆ triangles

uint32 G3D::RenderDevice::Stats::triangles

Number of triangles since last beginFrame()


documentation generated on Wed Nov 24 2021 08:01:59 using doxygen 1.8.15