class render::GpuQueryPool

Pool used for allocating GPU queries of a particular type.

Note a pool must be reset on a command buffer before first use.

Public

Constructors

GpuQueryPool

GpuQueryPool(const GpuQueryPoolCreateInformation &createInformation)

Methods

~GpuQueryPool

virtual ~GpuQueryPool() = default

GetQueryType

GpuQueryType GetQueryType() const

Retrieves the type of query managed by the pool.

GetPoolSize

u32 GetPoolSize() const

Returns the maximum number of queries to allocate by this pool.

AllocateQuery

virtual GpuQueryId AllocateQuery() = 0

Attempts to allocate a new query.

Returns an invalid ID if all queries in the pool have been exhausted.

TryResolve

virtual bool TryResolve(bool wait = false) = 0

Attempts to retrieve the query information from the GPU.

wait
If true, the caller will block until the information is available on the GPU.

Returns: Return true if the query is ready and results can be retrieved, or false if results are not ready yet.

GetQueryResult

virtual u64 GetQueryResult(GpuQueryId queryId, u32 elementIndex = 0) = 0

Returns the result of the query with the provided index.

Caller must ensure that TryEnsure() has been called previously, and it has returned true.

queryId
ID of the query to get the result for.
elementIndex
If query has multiple elements, index of the element. Timer and occlusion queries have only one element, while pipeline statistic queries have an element for each enabled statistic bit.

Protected

Fields

mQueryType

GpuQueryType mQueryType

mPoolSize

u32 mPoolSize

mElementsPerQuery

u32 mElementsPerQuery