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

Helper class to manage scoped queries. More...

#include <ScopedQueryHelper.hpp>

Public Member Functions

void Begin (IDeviceContext *pCtx)
 Begins a query.
 
bool End (IDeviceContext *pCtx, void *pData, Uint32 DataSize)
 Ends a query and returns the query data, if it is available.
 

Detailed Description

Helper class to manage scoped queries.

One scoped query instance must be used once per frame.

Member Function Documentation

◆ Begin()

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

Begins a query.

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

◆ End()

bool Diligent::ScopedQueryHelper::End ( IDeviceContext * pCtx,
void * pData,
Uint32 DataSize )

Ends a query and returns the query data, if it is available.

Parameters
[in]pCtx- Context to record end query command.
[out]pData- Pointer to the buffer that will receive query data.
[in]DataSize- Buffer data size.
Returns
true if the data from the oldest query is available, and false otherwise.
Remarks
There must be exactly one matching End() for every Begin() call, otherwise the behavior is undefined.