Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::DurationQueryHelper Class Reference

Helper class to manage duration queries. More...

#include <DurationQueryHelper.hpp>

Public Member Functions

void Begin (IDeviceContext *pCtx)
 Begins a query.
 
bool End (IDeviceContext *pCtx, double &Duration)
 Ends a query and returns the duration, in seconds, if it is available.
 

Detailed Description

Helper class to manage duration queries.

One DurationQueryHelper instance must be used once per frame.

Member Function Documentation

◆ Begin()

void Diligent::DurationQueryHelper::Begin ( IDeviceContext * pCtx)

Begins a query.

Parameters
[in]pCtx- Context to record begin query command
Note
There must be exactly one matching Begin() for every End() call, otherwise the behavior is undefined.

◆ End()

bool Diligent::DurationQueryHelper::End ( IDeviceContext * pCtx,
double & Duration )

Ends a query and returns the duration, in seconds, if it is available.

Parameters
[in]pCtx- Context to record end query command.
[out]Duration- Variable where duration will be written to.
Returns
true if the data from the oldest query is available, and false otherwise.
Note
There must be exactly one matching End() for every Begin() call, otherwise the behavior is undefined.