FrameStatistics

Functions

CID

GetClassID

void *

As

const void *

As

class T_As

As

class T_As

As

FrameStatistics

~FrameStatistics

FrameStatistics

RED_RC

operator=

void

QueryPassTime

bool

GetPassTimeQuery

float

GetClusterUpdateTime

float

GetClusterFlushTime

float

GetClusterGPUUpdateTime

int

GetClusterEventsCount

const ViewpointStatistics &

GetViewpointStatistics

int

GetVRLsCount

int

GetViewpointsCount

const ViewpointStatistics &

GetViewpointStatistics

Object *

GetWindow

Object *

GetVRL

int

GetStateNumber

Detailed Description

class FrameStatistics : public RED::Object

Information counters on the scene rendered by a window.

bk_analyzingperformances, task tk_enabling_frame_statistics

This class gives access to calculation counters on a frame. An instance of this object is sent to the RED::RENDERING_PROGRESS_CALLBACK that is defined by the RED::IWindow::SetRenderingProgressCallback method. This instance can also be accessed from the window that hosts it using RED::IWindow::GetFrameStatistics.

The software rendering of a frame is divided into rendering steps (RED::RENDERING_PROGRESS_STEP). Each rendering step is divided into rendering passes. Then, the RED::FrameStatistics object indicates various informations, such as the current step, the current pass, the progression in the pass, the number of objects in the scene, the number of rays actually processed, etc…

The hardware rendering of a frame is divided into rendering passes. Informations can be retrieved for each rendering pas that occurs for the rendering of the frame.

Statistics are accessible for each VRL and for each camera in that VRL. Use RED::FrameStatistics::GetViewpointStatistics to access these statistics.

By default, statistics have no hardware rendering passes timers enabled, as these timers are intrusive and slow down the rendering of the frame. Hardware timers can be setup using RED::FrameStatistics::QueryPassTime.

Public Functions

virtual void *As(const RED::CID &iCID)

Converts the object to an instance of the given type.

Parameters

iCID – Requested class.

Returns

An object pointer of the given class on success, NULL otherwise.

virtual const void *As(const RED::CID &iCID) const

Converts the object to an instance of the given type.

Parameters

iCID – Requested class.

Returns

An object pointer of the given class on success, NULL otherwise.

template<class T_As>
inline T_As *As()
template<class T_As>
inline const T_As *As() const
FrameStatistics()

FrameStatistics default construction method.

~FrameStatistics()

FrameStatistics destruction method.

FrameStatistics(const RED::FrameStatistics &iSrc)

FrameStatistics copy construction operator.

Parameters

iSrc – Source of the copy.

RED_RC operator=(const RED::FrameStatistics &iSrc)

Assignment operator.

Parameters

iSrc – Source of the operation.

Returns

RED_OK if the operation has succeeded,

RED_ALLOC_FAILURE if an internal allocation has failed.

inline void QueryPassTime(RED::RENDERING_PASS iPass, bool iEnableTimer)

Request timing of a pass.

Hardware rendering passes are all interleaved during the rendering of a frame. Therefore, timers are not relevant, as a pass execution does not occur right after rendering commands for it have been emitted.

This method can be used to enable timers and queries for the real time spent in a rendering pass. Setting iEnableTimer to true for iPass will cause a slight slowdown of the rendering (around 0.25 ms) for each instance of that pass during the processing of a frame. The time spent in that pass will then be available from the RED::PassStatistics class associated to that pass.

Parameters
  • iPass – The rendering pass.

  • iEnableTimer – Set to true to enable timers for that pass, false to disable timers (default).

inline bool GetPassTimeQuery(RED::RENDERING_PASS iPass) const

Query the actual timing of a pass.

Parameters

iPass – The rendering pass.

Returns

true if the pass is synchronized, false otherwise.

float GetClusterUpdateTime() const

Return the time taken by the last cluster update.

This is the time taken by the last transaction closing operation (RED::IResourceManager::EndState), retrieved directly from the resource manager object. All windows will report the same time for the same transaction number.

The cluster update time is the sum of the RED::FrameStatistics::GetClusterFlushTime and RED::FrameStatistics::GetClusterGPUUpdate time.

Returns

The time spent in RED::IResourceManager::EndState for the last closed transaction.

float GetClusterFlushTime() const

Return the cluster data flushing time taken during the last transaction closing operation.

This is the amount of time spent in the last RED::IResourceManager::EndState for several internal tasks, such as:

  • Commiting changes in modified scene graph objects,

  • Flushing pending destruction orders.

  • Flushing useless working rendering buffers.

Returns

The flush time spent in RED::IResourceManager::EndState for the last closed transaction.

float GetClusterGPUUpdateTime(RED::CLUSTER_GPU_TIME iCounter) const

Return a chunk of the cluster GPU update time taken during the last transaction closing operation.

The RED::CGT_ALL returns the entire cluster GPU update time.

Parameters

iCounter – The requested time counter.

Returns

The requested cluster GPU update time slice.

int GetClusterEventsCount() const

This method must be called from the same thread as the one that has closed the transaction

Returns

The number of events in the cluster for the last transaction that was closed.

inline const RED::ViewpointStatistics &GetViewpointStatistics(RED::Object *iVRL, RED::Object *iViewpoint) const

Access statistics for a given viewpoint.

Parameters
  • iVRL – The VRL hosting the viewpoint.

  • iViewpoint – The searched viewpoint.

inline int GetVRLsCount() const

Access the number of VRLs registered in the statistics.

Returns

The number of VRLs actually rendered and having statistics data.

inline int GetViewpointsCount(int iVRLNumber) const

Access the number of viewpoints registered for a given VRL number.

Parameters

iVRLNumber – the number of the VRL in the class.

Returns

The number of viewpoints for the i-th VRL in the statistics object.

inline const RED::ViewpointStatistics &GetViewpointStatistics(int iVRLNumber, int iViewpointNumber) const

Access the viewpoint frame statistics.

Parameters
  • iVRLNumber – The number of the VRL in the class.

  • iViewpointNumber – The number of the viewpoint in the VRL.

inline RED::Object *GetWindow() const

Gets the rendered window.

This method returns the window object being rendered and for which this statistics object is being created.

Returns

The window address.

inline RED::Object *GetVRL(int iVRLNumber) const
Parameters

iVRLNumber – The requested VRL number.

Returns

The VRL corresponding to the requested iVRLNumber.

inline int GetStateNumber() const

Gets the rendered transaction number for which the statistics were created.

Returns

The corresponding transaction number.

Public Static Functions

static inline RED::CID GetClassID()