ezEngine  Release 25.03
ezQueryPoolVulkan Class Reference

Pool for GPU queries. More...

#include <QueryPoolVulkan.h>

Public Member Functions

 ezQueryPoolVulkan (ezGALDeviceVulkan *pDevice)
 
void Initialize (ezUInt32 uiValidBits)
 Initializes the pool. More...
 
void DeInitialize ()
 
void AfterBeginFrame (vk::CommandBuffer commandBuffer)
 Needs to be called every frame so the pool can figure out which queries have finished and reuse old data.
 
void EnsureFreeQueryPoolSize (vk::CommandBuffer commandBuffer)
 We have to call this before each begin rendering call as if we run out of queries inside a render pass, we can't recover given that resetQueryPool can only be called outside a render pass which is necessary to be called on every new pool.
 
ezGALTimestampHandle InsertTimestamp (vk::CommandBuffer commandBuffer, vk::PipelineStageFlagBits pipelineStage=vk::PipelineStageFlagBits::eBottomOfPipe)
 Inserts a timestamp into the given command buffer. More...
 
ezEnum< ezGALAsyncResultGetTimestampResult (ezGALTimestampHandle hTimestamp, ezTime &out_result, bool bForce=false)
 Retrieves the timestamp value if it is available. More...
 
ezGALPoolHandle BeginOcclusionQuery (vk::CommandBuffer commandBuffer, ezEnum< ezGALQueryType > type)
 
void EndOcclusionQuery (vk::CommandBuffer commandBuffer, ezGALPoolHandle hPool)
 
ezEnum< ezGALAsyncResultGetOcclusionQueryResult (ezGALPoolHandle hPool, ezUInt64 &out_uiQueryResult, bool bForce=false)
 

Detailed Description

Pool for GPU queries.

Member Function Documentation

◆ GetTimestampResult()

ezEnum< ezGALAsyncResult > ezQueryPoolVulkan::GetTimestampResult ( ezGALTimestampHandle  hTimestamp,
ezTime out_result,
bool  bForce = false 
)

Retrieves the timestamp value if it is available.

Parameters
hTimestampThe target timestamp to resolve.
resultThe time of the timestamp. If this is empty on success the timestamp has expired.
bForceWait for the timestamp to become available.
Returns
Returns false if the result is not available yet.

◆ Initialize()

void ezQueryPoolVulkan::Initialize ( ezUInt32  uiValidBits)

Initializes the pool.

Parameters
uiValidBitsThe number of valid bits in the query result. Each queue has different query characteristics and a separate pool is needed for each queue.

◆ InsertTimestamp()

ezGALTimestampHandle ezQueryPoolVulkan::InsertTimestamp ( vk::CommandBuffer  commandBuffer,
vk::PipelineStageFlagBits  pipelineStage = vk::PipelineStageFlagBits::eBottomOfPipe 
)

Inserts a timestamp into the given command buffer.

Parameters
commandBufferTarget command buffer to insert the timestamp into.
hTimestampTimestamp to insert. After insertion the only valid option is to call GetTimestampResult.
pipelineStageThe value of the timestamp will be the point in time in which all previously committed commands have finished this stage.

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