Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
QueryAllocator Class Reference

Manages GPU queries allocation in a set of pools. Pools need to be buffered per frame so that we can retrieve the previous frame queries while the current queries are running. More...

#include <QueryAllocator.hpp>

Public Member Functions

void init (GPUQuery::Type type, uint count)
 
uint allocate ()
 
void resetWritePool ()
 
VkQueryPool & getWritePool ()
 
VkQueryPool & getReadPool ()
 
void clean ()
 

Private Attributes

std::vector< VkQueryPool > _pools
 Per-frame native query pools.
 
uint _totalCount = 0u
 Total size of each pool, in queries.
 
uint _currentCount = 0u
 Current number of allocated queries.
 
uint _itemSize = 1u
 Number of hardware queries used for the given query type (two for duration queries, fi).
 

Detailed Description

Manages GPU queries allocation in a set of pools. Pools need to be buffered per frame so that we can retrieve the previous frame queries while the current queries are running.

Member Function Documentation

◆ allocate()

uint QueryAllocator::allocate ( )

Allocate a query and returns its offset in the pool.

Returns
offset in the pool.

◆ clean()

void QueryAllocator::clean ( )

Clean the query pools.

◆ getReadPool()

VkQueryPool & QueryAllocator::getReadPool ( )
Returns
the previous frame pool (for retrieving the values)

◆ getWritePool()

VkQueryPool & QueryAllocator::getWritePool ( )
Returns
the current frame pool (for starting/ending queries)

◆ init()

void QueryAllocator::init ( GPUQuery::Type  type,
uint  count 
)

Setup the allocator for a given query type.

Parameters
typethe type of queries to store
countthe total number of queries to allocate

◆ resetWritePool()

void QueryAllocator::resetWritePool ( )

Reset the pool that will be used at the current frame for new queries.


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