|
CeresEngine 0.2.0
A game development framework
|
A GPU query that allows measuring the time a GPU device takes execute a set of commands on a command buffer. More...
#include <CeresEngine/RenderAPI/GPUQuery.hpp>
Classes | |
| class | Scope |
| A helper class that begins a scoped timer query. More... | |
Public Member Functions | |
| GPUTimerQuery (const GPUTimerQuery &)=delete | |
| Deleted copy constructor. | |
| GPUTimerQuery & | operator= (const GPUTimerQuery &)=delete |
| GPUTimerQuery (GPUTimerQuery &&)=delete | |
| Deleted move constructor. | |
| GPUTimerQuery & | operator= (GPUTimerQuery &&)=delete |
| virtual void | begin (GPUCommandBuffer &commandBuffer, UInt32 timerIndex=0)=0 |
| Begins the timer query. | |
| virtual void | end (GPUCommandBuffer &commandBuffer, UInt32 timerIndex=0)=0 |
| Ends the timer query. | |
| virtual bool | isComplete (UInt32 timerIndex=0) const =0 |
| Checks if the timer query is complete and ready to get the value. | |
| virtual void | wait (UInt32 timerIndex=0) const =0 |
| Waits until the timer query is complete. | |
| virtual GPUTimerQueryResult | getValue (UInt32 timerIndex=0) const =0 |
Gets the amount of seconds the GPU took to run the commands between the begin() and the end() cals. | |
| virtual void | reset ()=0 |
| Resets the timer query so that it can be re-used by another command buffer. | |
| template<typename Func > | |
| decltype(auto) | with (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(auto) | with (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 | |
| TDeviceObject & | operator= (const TDeviceObject &)=delete |
| TDeviceObject & | operator= (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 | |
| GPUObject & | operator= (const GPUObject &)=delete |
| GPUObject (GPUObject &&)=delete | |
| GPUObject & | operator= (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 Attributes | |
| Event< void(GPUTimerQueryResult)> | didComplete |
| An event triggered whenever the query result becomes available. | |
Public Attributes inherited from CeresEngine::TDeviceObject< GPUTimerQueryDescriptor > | |
| const Descriptor & | descriptor |
| A structure that describes the object and it's properties. | |
Public Attributes inherited from CeresEngine::GPUDeviceObject | |
| GPUDevice & | device |
| The owning device this object was created from. | |
Additional Inherited Members | |
Public Types inherited from CeresEngine::TDeviceObject< GPUTimerQueryDescriptor > | |
| using | Descriptor = GPUTimerQueryDescriptor |
| An type-alias to the descriptor struct type. | |
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. | |
A GPU query that allows measuring the time a GPU device takes execute a set of commands on a command buffer.
|
delete |
Deleted copy constructor.
|
delete |
Deleted move constructor.
|
pure virtual |
Begins the timer query.
This will insert a command to write the current timestamp and use it as the starting timestamp.
end() to ensure that the measurement is ended. You can alternatively use with() which will measure all GPU commands triggered inside it.| commandBuffer | The command buffer to start the timer query at. |
| timerIndex | The index of the timer query to be started. |
Implemented in CeresEngine::VKTimerQuery.
|
pure virtual |
Ends the timer query.
This will insert a command to write the current timestamp and use it as the ending timestamp.
| commandBuffer | The command buffer to end the timer query at. |
| timerIndex | The index of the timer query to be ended. |
Implemented in CeresEngine::VKTimerQuery.
|
pure virtual |
Gets the amount of seconds the GPU took to run the commands between the begin() and the end() cals.
end() call, if isReady() returns false. Implemented in CeresEngine::VKTimerQuery.
Checks if the timer query is complete and ready to get the value.
getValue() won't block. Implemented in CeresEngine::VKTimerQuery.
|
delete |
|
delete |
Resets the timer query so that it can be re-used by another command buffer.
Implemented in CeresEngine::VKTimerQuery.
|
delete |
Inherited constructors.
|
inlineexplicit |
Inherited constructors.
|
delete |
Inherited constructors.
Waits until the timer query is complete.
end() call. Implemented in CeresEngine::VKTimerQuery.
|
inline |
|
inline |
Measures the time the GPU takes to run the commands run in commandBuffer from inside the given func.
| Func | A callable object that adds commands to the command buffer. |
| commandBuffer | The command buffer to start the query on. |
| func | A callable object that adds commands to the command buffer. |
| Event<void(GPUTimerQueryResult)> CeresEngine::GPUTimerQuery::didComplete |
An event triggered whenever the query result becomes available.