CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::VKTimerQuery Class Referencefinal

The Vulkan implementation of TimerQuery. More...

#include <CeresEngine/RenderAPI/Vulkan/VKTimerQuery.hpp>

Inheritance diagram for CeresEngine::VKTimerQuery:
CeresEngine::GPUTimerQuery CeresEngine::VKDeviceObject< VKTimerQuery, GPUTimerQuery > CeresEngine::GPUQuery CeresEngine::TDeviceObject< GPUTimerQueryDescriptor > CeresEngine::VKObject< ChildTypeName, ParentType > CeresEngine::VKDeviceObjectBase CeresEngine::GPUDeviceObject CeresEngine::VKObjectBase CeresEngine::GPUObject

Public Types

using Allocator = VKObjectAllocator
 An allocator type used to allocate new VKTimerQuery instances from a memory pool.
 
- Public Types inherited from CeresEngine::TDeviceObject< GPUTimerQueryDescriptor >
using Descriptor = GPUTimerQueryDescriptor
 An type-alias to the descriptor struct type.
 

Public Member Functions

 VKTimerQuery (VKDevice &device, const GPUTimerQueryDescriptor &descriptor)
 Creates a new VKTimerQuery object.
 
 ~VKTimerQuery () final
 Destroys the VKTimerQuery object.
 
 operator VkQueryPool () const noexcept
 The Vulkan query pool object.
 
void begin (GPUCommandBuffer &commandBuffer, UInt32 timerIndex=0) final
 
void end (GPUCommandBuffer &commandBuffer, UInt32 timerIndex=0) final
 
bool isComplete (UInt32 timerIndex=0) const final
 
void wait (UInt32 timerIndex=0) const final
 
GPUTimerQueryResult getValue (UInt32 timerIndex=0) const final
 
void reset () final
 
bool tryFinish ()
 Try finish the execution of the query.
 
- Public Member Functions inherited from CeresEngine::GPUTimerQuery
 GPUTimerQuery (const GPUTimerQuery &)=delete
 Deleted copy constructor.
 
GPUTimerQueryoperator= (const GPUTimerQuery &)=delete
 
 GPUTimerQuery (GPUTimerQuery &&)=delete
 Deleted move constructor.
 
GPUTimerQueryoperator= (GPUTimerQuery &&)=delete
 
template<typename Func >
decltype(autowith (GPUCommandBuffer &commandBuffer, Func &&func)
 Measures the time the GPU takes to run the commands run in commandBuffer from inside the given func.
 
template<typename Func >
decltype(autowith (GPUCommandBuffer &commandBuffer, const UInt32 timerIndex, Func &&func)
 
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Inherited constructors.
 
 TDeviceObject (const TDeviceObject &)=delete
 Inherited constructors.
 
 TDeviceObject (TDeviceObject &&)=delete
 Inherited constructors.
 
- Public Member Functions inherited from CeresEngine::TDeviceObject< GPUTimerQueryDescriptor >
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Initializes a new RenderAPI device object instance.
 
 TDeviceObject (const TDeviceObject &)=delete
 
 TDeviceObject (TDeviceObject &&)=delete
 
 ~TDeviceObject () override=default
 
TDeviceObjectoperator= (const TDeviceObject &)=delete
 
TDeviceObjectoperator= (TDeviceObject &&)=delete
 
- Public Member Functions inherited from CeresEngine::GPUDeviceObject
 GPUDeviceObject (GPUDevice &device)
 
 ~GPUDeviceObject () override
 
- Public Member Functions inherited from CeresEngine::GPUObject
 GPUObject ()=default
 
virtual ~GPUObject ()=default
 
 GPUObject (const GPUObject &)=delete
 
GPUObjectoperator= (const GPUObject &)=delete
 
 GPUObject (GPUObject &&)=delete
 
GPUObjectoperator= (GPUObject &&)=delete
 
void retain () noexcept
 Retains the object by increment it's reference count by one.
 
bool release () noexcept
 Releases the object by decrementing it's reference count by one.
 
- Public Member Functions inherited from CeresEngine::VKDeviceObjectBase
 VKDeviceObjectBase (VKDevice &device) noexcept
 Creates a new VKDeviceObjectBase from the given device.
 
 ~VKDeviceObjectBase () noexcept
 Destroys the VKDeviceObjectBase.
 

Static Public Member Functions

static AllocatorgetAllocator () noexcept
 Returns the allocator for VKTimerQuery.
 
static voidoperator new (size_t size) noexcept
 Allocates memory for a new instance of VKTimerQuery.
 
static void operator delete (void *p, std::size_t sz) noexcept
 Deletes memory for an instance of VKTimerQuery.
 
- Static Public Member Functions inherited from CeresEngine::VKObject< ChildTypeName, ParentType >
static RC< ChildTypeNamecast (const RC< ParentType > &ptr)
 Casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName.
 
static ChildTypeNamecast (ParentType &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamecast (const ParentType &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static ChildTypeNamecast (ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamecast (const ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
- Static Public Member Functions inherited from CeresEngine::VKObjectBase
static voidoperator new (size_t size) noexcept
 
static void operator delete (void *p, std::size_t sz) noexcept
 

Private Attributes

const GPUTimerQueryDescriptor descriptorVK
 A structure that describes the timerQuery and it's properties.
 
VkQueryPool mQueryPool = VK_NULL_HANDLE
 The Vulkan query pool object.
 
UInt32 mQueryCount = 0
 The number of queries in the pool.
 
UInt32 mQueueFamily
 The queue getFamilyIndex the timer query was executed on.
 

Additional Inherited Members

- Public Attributes inherited from CeresEngine::GPUTimerQuery
Event< void(GPUTimerQueryResult)> didComplete
 An event triggered whenever the query result becomes available.
 
- Public Attributes inherited from CeresEngine::TDeviceObject< GPUTimerQueryDescriptor >
const Descriptordescriptor
 A structure that describes the object and it's properties.
 
- Public Attributes inherited from CeresEngine::GPUDeviceObject
GPUDevicedevice
 The owning device this object was created from.
 
- Public Attributes inherited from CeresEngine::VKDeviceObjectBase
VKDevicedeviceVK
 The owning VKDevice instance.
 
- Protected Member Functions inherited from CeresEngine::GPUObject
virtual void destroy () noexcept
 A internal method called by the system when the object reference count reaches zero.
 
- Protected Member Functions inherited from CeresEngine::VKDeviceObject< VKTimerQuery, GPUTimerQuery >
 VKDeviceObject (VKDevice &device) noexcept
 Creates a new VKDeviceObject from the given device.
 

Detailed Description

The Vulkan implementation of TimerQuery.

Member Typedef Documentation

◆ Allocator

An allocator type used to allocate new VKTimerQuery instances from a memory pool.

Constructor & Destructor Documentation

◆ VKTimerQuery()

CeresEngine::VKTimerQuery::VKTimerQuery ( VKDevice device,
const GPUTimerQueryDescriptor descriptor 
)
explicit

Creates a new VKTimerQuery object.

Parameters
deviceThe owning device
descriptorThe descriptor object that describes the object

◆ ~VKTimerQuery()

CeresEngine::VKTimerQuery::~VKTimerQuery ( )
final

Destroys the VKTimerQuery object.

Member Function Documentation

◆ begin()

void CeresEngine::VKTimerQuery::begin ( GPUCommandBuffer commandBuffer,
UInt32  timerIndex = 0 
)
finalvirtual

◆ end()

void CeresEngine::VKTimerQuery::end ( GPUCommandBuffer commandBuffer,
UInt32  timerIndex = 0 
)
finalvirtual

◆ getAllocator()

static Allocator & CeresEngine::VKTimerQuery::getAllocator ( )
staticnoexcept

Returns the allocator for VKTimerQuery.

◆ getValue()

GPUTimerQueryResult CeresEngine::VKTimerQuery::getValue ( UInt32  timerIndex = 0) const
finalvirtual

◆ isComplete()

bool CeresEngine::VKTimerQuery::isComplete ( UInt32  timerIndex = 0) const
finalvirtual

◆ operator delete()

static void CeresEngine::VKTimerQuery::operator delete ( void p,
std::size_t  sz 
)
staticnoexcept

Deletes memory for an instance of VKTimerQuery.

◆ operator new()

static void * CeresEngine::VKTimerQuery::operator new ( size_t  size)
staticnoexcept

Allocates memory for a new instance of VKTimerQuery.

◆ operator VkQueryPool()

CeresEngine::VKTimerQuery::operator VkQueryPool ( ) const
inlinenoexcept

The Vulkan query pool object.

◆ reset()

void CeresEngine::VKTimerQuery::reset ( )
finalvirtual

◆ tryFinish()

bool CeresEngine::VKTimerQuery::tryFinish ( )

Try finish the execution of the query.

If the query is not ready, false is returned.

◆ wait()

void CeresEngine::VKTimerQuery::wait ( UInt32  timerIndex = 0) const
finalvirtual

Member Data Documentation

◆ descriptorVK

const GPUTimerQueryDescriptor CeresEngine::VKTimerQuery::descriptorVK
private

A structure that describes the timerQuery and it's properties.

◆ mQueryCount

UInt32 CeresEngine::VKTimerQuery::mQueryCount = 0
private

The number of queries in the pool.

◆ mQueryPool

VkQueryPool CeresEngine::VKTimerQuery::mQueryPool = VK_NULL_HANDLE
private

The Vulkan query pool object.

◆ mQueueFamily

UInt32 CeresEngine::VKTimerQuery::mQueueFamily
private

The queue getFamilyIndex the timer query was executed on.


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