Vireo  0.0
Vireo 3D Rendering Hardware Interface
QueryPool Class Referenceabstract

Detailed Description

A GPU timestamp query pool, used for GPU-side performance profiling.

+ Inheritance diagram for QueryPool:

Public Member Functions

auto getCapacity () const
 
auto getTimestampPeriodMs () const
 
virtual std::vector< uint64_tgetResults (uint32_t firstQuery, uint32_t queryCount) const = 0
 
virtual ~QueryPool () = default
 
 QueryPool (const QueryPool &) = delete
 
QueryPool & operator= (const QueryPool &) = delete
 

Protected Member Functions

 QueryPool (const uint32_t capacity, const double timestampPeriodMs)
 

Protected Attributes

uint32_t capacity
 
double timestampPeriodMs
 

Constructor & Destructor Documentation

virtual ~QueryPool ( )
virtualdefault
QueryPool ( const QueryPool &  )
delete
QueryPool ( const uint32_t  capacity,
const double  timestampPeriodMs 
)
inlineprotected

Member Function Documentation

auto getCapacity ( ) const
inline

Returns the maximum number of timestamp slots in this pool.

virtual std::vector<uint64_t> getResults ( uint32_t  firstQuery,
uint32_t  queryCount 
) const
pure virtual

Reads back resolved timestamp values from the host-visible buffer.

Parameters
firstQueryIndex of the first query slot to read.
queryCountNumber of consecutive slots to read.
Returns
A vector of raw 64-bit GPU tick values. Convert to ms with getTimestampPeriodMs().
Note
Must only be called after the command list containing the matching resolveQueryPool() call has fully finished executing on the GPU (i.e. after the associated Fence has been signaled).
auto getTimestampPeriodMs ( ) const
inline

Returns the period (in milliseconds) of one GPU clock tick. Multiply a raw tick difference by this value to get a duration in ms.

QueryPool& operator= ( const QueryPool &  )
delete

Member Data Documentation

uint32_t capacity
protected
double timestampPeriodMs
protected