VTK
Public Member Functions | Protected Attributes | List of all members
vtkOpenGLRenderTimer Class Reference

Asynchronously measures GPU execution time. More...

#include <vtkOpenGLRenderTimer.h>

Public Member Functions

 vtkOpenGLRenderTimer ()
 
 ~vtkOpenGLRenderTimer ()
 
void Reset ()
 Clear out any previous results and prepare for a new query. More...
 
void Start ()
 Mark the start of a timed event. More...
 
void Stop ()
 Mark the end of a timed event. More...
 
bool Started ()
 Returns true if the timer has been started. More...
 
bool Stopped ()
 Returns true if the timer has been stopped. More...
 
bool Ready ()
 Returns true when the timing results are available. More...
 
float GetElapsedSeconds ()
 If Ready() returns true, get the elapsed time in the requested units. More...
 
float GetElapsedMilliseconds ()
 If Ready() returns true, get the elapsed time in the requested units. More...
 
vtkTypeUInt64 GetElapsedNanoseconds ()
 If Ready() returns true, get the elapsed time in the requested units. More...
 

Protected Attributes

bool StartReady
 
bool EndReady
 
vtkTypeUInt32 StartQuery
 
vtkTypeUInt32 EndQuery
 
vtkTypeUInt64 StartTime
 
vtkTypeUInt64 EndTime
 

Detailed Description

Asynchronously measures GPU execution time.

This class posts events to the OpenGL server to measure execution times of GPU processes. The queries are asynchronous and multiple vtkOpenGLRenderTimers may overlap / be nested.

This uses GL_TIMESTAMP rather than GL_ELAPSED_TIME, since only one GL_ELAPSED_TIME query may be active at a time. Since GL_TIMESTAMP is not available on OpenGL ES2

Definition at line 36 of file vtkOpenGLRenderTimer.h.

Constructor & Destructor Documentation

vtkOpenGLRenderTimer::vtkOpenGLRenderTimer ( )
vtkOpenGLRenderTimer::~vtkOpenGLRenderTimer ( )

Member Function Documentation

void vtkOpenGLRenderTimer::Reset ( )

Clear out any previous results and prepare for a new query.

void vtkOpenGLRenderTimer::Start ( )

Mark the start of a timed event.

void vtkOpenGLRenderTimer::Stop ( )

Mark the end of a timed event.

bool vtkOpenGLRenderTimer::Started ( )

Returns true if the timer has been started.

The query may not be ready yet.

bool vtkOpenGLRenderTimer::Stopped ( )

Returns true if the timer has been stopped.

The query may not be ready yet.

bool vtkOpenGLRenderTimer::Ready ( )

Returns true when the timing results are available.

float vtkOpenGLRenderTimer::GetElapsedSeconds ( )

If Ready() returns true, get the elapsed time in the requested units.

float vtkOpenGLRenderTimer::GetElapsedMilliseconds ( )

If Ready() returns true, get the elapsed time in the requested units.

vtkTypeUInt64 vtkOpenGLRenderTimer::GetElapsedNanoseconds ( )

If Ready() returns true, get the elapsed time in the requested units.

Member Data Documentation

bool vtkOpenGLRenderTimer::StartReady
protected

Definition at line 82 of file vtkOpenGLRenderTimer.h.

bool vtkOpenGLRenderTimer::EndReady
protected

Definition at line 83 of file vtkOpenGLRenderTimer.h.

vtkTypeUInt32 vtkOpenGLRenderTimer::StartQuery
protected

Definition at line 85 of file vtkOpenGLRenderTimer.h.

vtkTypeUInt32 vtkOpenGLRenderTimer::EndQuery
protected

Definition at line 86 of file vtkOpenGLRenderTimer.h.

vtkTypeUInt64 vtkOpenGLRenderTimer::StartTime
protected

Definition at line 88 of file vtkOpenGLRenderTimer.h.

vtkTypeUInt64 vtkOpenGLRenderTimer::EndTime
protected

Definition at line 89 of file vtkOpenGLRenderTimer.h.


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