LiteFX 0.3.1.2022
Computer Graphics Engine
|
The interface for a command queue. More...
#include <rendering_api.hpp>
Inherited by LiteFX::Rendering::CommandQueue< DirectX12CommandBuffer >, LiteFX::Rendering::CommandQueue< VulkanCommandBuffer >, and LiteFX::Rendering::CommandQueue< TCommandBuffer >.
Public Member Functions | |
virtual | ~ICommandQueue () noexcept=default |
virtual bool | isBound () const noexcept=0 |
Returns true , if the command queue is bound on the parent device. More... | |
virtual const QueuePriority & | priority () const noexcept=0 |
Returns the priority of the queue. More... | |
virtual const QueueType & | type () const noexcept=0 |
Returns the type of the queue. More... | |
virtual void | bind ()=0 |
Binds the queue on the parent device. More... | |
virtual void | release ()=0 |
Releases the queue from the parent device. More... | |
UniquePtr< ICommandBuffer > | createCommandBuffer (const bool &beginRecording=false) const |
Creates a command buffer that can be used to allocate commands on the queue. More... | |
UInt64 | submit (const ICommandBuffer &commandBuffer) const |
Submits a single command buffer and inserts a fence to wait for it. More... | |
UInt64 | submit (const Array< const ICommandBuffer * > &commandBuffers) const |
Submits a set of command buffers and inserts a fence to wait for them. More... | |
virtual void | waitFor (const UInt64 &fence) const noexcept=0 |
Waits for a certain fence value to complete on the command queue. More... | |
virtual UInt64 | currentFence () const noexcept=0 |
Returns the value of the latest fence inserted into the queue. More... | |
The interface for a command queue.
|
virtualdefaultnoexcept |
|
pure virtual |
Binds the queue on the parent device.
Implemented in LiteFX::Rendering::Backends::DirectX12Queue, and LiteFX::Rendering::Backends::VulkanQueue.
|
inline |
Creates a command buffer that can be used to allocate commands on the queue.
beginRecording | If set to true , the command buffer will be initialized in recording state and can receive commands straight away. |
|
pure virtualnoexcept |
Returns the value of the latest fence inserted into the queue.
Implemented in LiteFX::Rendering::Backends::DirectX12Queue, and LiteFX::Rendering::Backends::VulkanQueue.
|
pure virtualnoexcept |
Returns true
, if the command queue is bound on the parent device.
Before a command queue can receive commands, it needs to be bound to a device. This ensures, that the queue is actually able to allocate commands. A command queue starts in unbound state until bind gets called. Destroying the queue also releases it by calling release.
true
, if the command queue is bound on a device.Implemented in LiteFX::Rendering::Backends::DirectX12Queue, and LiteFX::Rendering::Backends::VulkanQueue.
|
pure virtualnoexcept |
Returns the priority of the queue.
Implemented in LiteFX::Rendering::Backends::DirectX12Queue, and LiteFX::Rendering::Backends::VulkanQueue.
|
pure virtual |
Releases the queue from the parent device.
Implemented in LiteFX::Rendering::Backends::DirectX12Queue, and LiteFX::Rendering::Backends::VulkanQueue.
|
inline |
Submits a set of command buffers and inserts a fence to wait for them.
Note that submitting a command buffer that is currently recording will implicitly close the command buffer.
commandBuffers | The command buffers to submit to the command queue. |
|
inline |
Submits a single command buffer and inserts a fence to wait for it.
Note that submitting a command buffer that is currently recording will implicitly close the command buffer.
commandBuffer | The command buffer to submit to the command queue. |
|
pure virtualnoexcept |
Returns the type of the queue.
Implemented in LiteFX::Rendering::Backends::DirectX12Queue, and LiteFX::Rendering::Backends::VulkanQueue.
|
pure virtualnoexcept |
Waits for a certain fence value to complete on the command queue.
Each time one or more command buffers are submitted to the queue, a fence is inserted and its value will be returned. By calling this method, it is possible to wait for this fence. A fence value is guaranteed to be larger than earlier fences, so the method returns, if the latest signaled fence value is larger or equal to the value specified in fence .
Note that this behavior can cause overflows when performing excessive fencing! Take for example a scenario, where each frame requires 80 fences to be signaled and an application that runs at 60 frames per second in average. In this case, each second 4.800 fences are inserted into the queue. Given the limit of an 64 bit unsigned integer fence value, the application can run ~2.9 billion years before overflowing. Drop me an e-mail or open an issue, if you ever happen to run into such a situation.
fence | The value of the fence to wait for. |
Implemented in LiteFX::Rendering::Backends::DirectX12Queue, and LiteFX::Rendering::Backends::VulkanQueue.