The interface for a command queue.
More...
#include <rendering_api.hpp>
Inherits LiteFX::SharedObject.
Inherited by LiteFX::Rendering::CommandQueue< DirectX12CommandBuffer >, LiteFX::Rendering::CommandQueue< VulkanCommandBuffer >, and LiteFX::Rendering::CommandQueue< TCommandBuffer >.
|
template<typename T , typename... TArgs> |
static auto | create (TArgs &&... args) -> SharedPtr< T > |
| Generic factory method used to create instances of the shared object.
|
|
The interface for a command queue.
◆ ICommandQueue() [1/3]
LiteFX::Rendering::ICommandQueue::ICommandQueue |
( |
| ) |
|
|
protecteddefaultnoexcept |
◆ ICommandQueue() [2/3]
LiteFX::Rendering::ICommandQueue::ICommandQueue |
( |
const ICommandQueue & | | ) |
|
|
protecteddefault |
◆ ICommandQueue() [3/3]
LiteFX::Rendering::ICommandQueue::ICommandQueue |
( |
ICommandQueue && | | ) |
|
|
protecteddefaultnoexcept |
◆ ~ICommandQueue()
LiteFX::Rendering::ICommandQueue::~ICommandQueue |
( |
| ) |
|
|
overridedefaultnoexcept |
◆ beginDebugRegion()
Starts a new debug region.
This method is a debug helper, that is not required to be implemented. In the built-in backends, it will no-op by default in non-debug builds.
- Parameters
-
label | The name of the debug region. |
color | The color of the debug region. |
◆ createCommandBuffer()
SharedPtr< ICommandBuffer > LiteFX::Rendering::ICommandQueue::createCommandBuffer |
( |
bool | beginRecording = false, |
|
|
bool | secondary = false ) const |
|
inline |
Creates a command buffer that can be used to allocate commands on the queue.
Specifying secondary allows to create secondary command buffers (aka. bundles). Those are intended to be used as efficient pre-recorded command buffers that are re-used multiple times. Using such a command buffer allows drivers to pre-apply optimizations, which causes a one-time cost during setup, but reduces cost when re- applying the command buffer multiple times. Ideally they are used as small chunks of re-occurring workloads.
A secondary command buffer must not be submitted to a queue, but rather to a primary command buffer by calling ICommandBuffer::execute.
- Parameters
-
beginRecording | If set to true , the command buffer will be initialized in recording state and can receive commands straight away. |
secondary | If set to true , the method will create a secondary command buffer/bundle. |
- Returns
- The instance of the command buffer.
◆ currentFence()
virtual UInt64 LiteFX::Rendering::ICommandQueue::currentFence |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ endDebugRegion()
virtual void LiteFX::Rendering::ICommandQueue::endDebugRegion |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Ends the current debug region.
This is a debug helper, that is not required to be implemented. In the built-in backends, it will no-op by default in non-debug builds.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ priority()
virtual QueuePriority LiteFX::Rendering::ICommandQueue::priority |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ releaseSharedState()
void LiteFX::Rendering::ICommandQueue::releaseSharedState |
( |
const ICommandBuffer & | commandBuffer | ) |
const |
|
inlineprotected |
◆ setDebugMarker()
Inserts a debug marker.
This method is a debug helper, that is not required to be implemented. In the built-in backends, it will no-op by default in non-debug builds.
- Parameters
-
label | The name of the debug marker. |
color | The color of the debug marker. |
◆ submit() [1/3]
Submits a single command buffer with shared ownership and inserts a fence to wait for it.
By calling this method, the queue takes shared ownership over the commandBuffer until the fence is passed. The reference will be released during a waitFor, if the awaited fence is inserted after the associated one.
Note that submitting a command buffer that is currently recording will implicitly close the command buffer.
- Parameters
-
commandBuffer | The command buffer to submit to the command queue. |
- Returns
- The value of the fence, inserted after the command buffer.
- See also
- waitFor
◆ submit() [2/3]
Submits a single command buffer with shared ownership and inserts a fence to wait for it.
By calling this method, the queue takes shared ownership over the commandBuffer until the fence is passed. The reference will be released during a waitFor, if the awaited fence is inserted after the associated one.
Note that submitting a command buffer that is currently recording will implicitly close the command buffer.
- Parameters
-
commandBuffer | The command buffer to submit to the command queue. |
- Returns
- The value of the fence, inserted after the command buffer.
- See also
- waitFor
◆ submit() [3/3]
Submits a set of command buffers with shared ownership and inserts a fence to wait for them.
By calling this method, the queue takes shared ownership over the commandBuffers until the fence is passed. The reference will be released during a waitFor, if the awaited fence is inserted after the associated one.
Note that submitting a command buffer that is currently recording will implicitly close the command buffer.
- Parameters
-
commandBuffers | The command buffers to submit to the command queue. |
- Returns
- The value of the fence, inserted after the command buffers.
- See also
- waitFor
◆ type()
virtual QueueType LiteFX::Rendering::ICommandQueue::type |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ waitFor() [1/2]
void LiteFX::Rendering::ICommandQueue::waitFor |
( |
const ICommandQueue & | queue, |
|
|
UInt64 | fence ) const |
|
inline |
Lets the command queue wait for a certain fence value to complete on another queue.
This overload performs a GPU-side wait, i.e., the current command queue waits until queue has passed the fence value provided by the fence parameter. This overload does return immediately and does not block the CPU.
- Parameters
-
queue | The queue to wait upon. |
fence | The value of the fence to wait upon on the other queue. |
◆ waitFor() [2/2]
virtual void LiteFX::Rendering::ICommandQueue::waitFor |
( |
UInt64 | fence | ) |
const |
|
pure virtual |
◆ DEFAULT_DEBUG_COLOR
Vectors::ByteVector3 LiteFX::Rendering::ICommandQueue::DEFAULT_DEBUG_COLOR = { 128_b, 128_b, 128_b } |
|
staticconstexpr |
◆ submitted
Invoked, after one or more command buffers have been submitted to the queue.
◆ submitting
Invoked, when one or more command buffers are submitted to the queue.