LiteFX 0.3.1.2022
Computer Graphics Engine
LiteFX::Rendering::Backends::DirectX12Queue Class Reference

Implements a DirectX 12 command queue. More...

#include <dx12.hpp>

Inherits LiteFX::Rendering::CommandQueue< DirectX12CommandBuffer >, and LiteFX::Resource< THandle >.

Classes

class  DirectX12QueueImpl
 

Public Member Functions

 DirectX12Queue (const DirectX12Device &device, const QueueType &type, const QueuePriority &priority)
 Initializes the DirectX 12 command queue. More...
 
 DirectX12Queue (const DirectX12Queue &)=delete
 
 DirectX12Queue (DirectX12Queue &&)=delete
 
virtual ~DirectX12Queue () noexcept
 
virtual const DirectX12Devicedevice () const noexcept
 Returns a reference to the device that provides this queue. More...
 
virtual bool isBound () const noexcept override
 Returns true, if the command queue is bound on the parent device. More...
 
virtual const QueuePriority & priority () const noexcept override
 Returns the priority of the queue. More...
 
virtual const QueueType & type () const noexcept override
 Returns the type of the queue. More...
 
virtual void bind () override
 Binds the queue on the parent device. More...
 
virtual void release () override
 Releases the queue from the parent device. More...
 
virtual UniquePtr< DirectX12CommandBuffercreateCommandBuffer (const bool &beginRecording=false) const override
 
virtual UInt64 submit (const DirectX12CommandBuffer &commandBuffer) const override
 
virtual UInt64 submit (const Array< const DirectX12CommandBuffer * > &commandBuffers) const override
 
virtual void waitFor (const UInt64 &fence) const noexcept override
 Waits for a certain fence value to complete on the command queue. More...
 
virtual UInt64 currentFence () const noexcept override
 Returns the value of the latest fence inserted into the queue. More...
 
- Public Member Functions inherited from LiteFX::Rendering::CommandQueue< DirectX12CommandBuffer >
virtual ~CommandQueue () noexcept=default
 
virtual UniquePtr< command_buffer_typecreateCommandBuffer (const bool &beginRecording=false) const=0
 
virtual UInt64 submit (const command_buffer_type &commandBuffer) const=0
 
virtual UInt64 submit (const Array< const command_buffer_type * > &commandBuffers) const=0
 
- Public Member Functions inherited from LiteFX::Rendering::ICommandQueue
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< ICommandBuffercreateCommandBuffer (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...
 
- Public Member Functions inherited from LiteFX::Resource< THandle >
 Resource (const Resource &)=delete
 
 Resource (Resource &&)=delete
 
virtual ~Resource () noexcept=default
 
const THandle & handle () const noexcept override
 Returns the resource managed by the class. More...
 
- Public Member Functions inherited from LiteFX::IResource< THandle >
virtual ~IResource () noexcept=default
 
virtual const THandle & handle () const noexcept=0
 Returns the resource managed by the class. More...
 

Additional Inherited Members

- Public Types inherited from LiteFX::Rendering::CommandQueue< DirectX12CommandBuffer >
using command_buffer_type = DirectX12CommandBuffer
 
- Protected Member Functions inherited from LiteFX::Resource< THandle >
 Resource (const THandle handle) noexcept
 Initializes the managed resource. More...
 
THandle & handle () noexcept override
 Returns the resource managed by the class. More...
 
virtual THandle & handle () noexcept=0
 Returns the resource managed by the class. More...
 

Detailed Description

Implements a DirectX 12 command queue.

See also
DirectX12CommandBuffer

Constructor & Destructor Documentation

◆ DirectX12Queue() [1/3]

DirectX12Queue::DirectX12Queue ( const DirectX12Device device,
const QueueType &  type,
const QueuePriority &  priority 
)
explicit

Initializes the DirectX 12 command queue.

Parameters
deviceThe device, commands get send to.
typeThe type of the command queue.
priorityThe priority, of which commands are issued on the device.

◆ DirectX12Queue() [2/3]

LiteFX::Rendering::Backends::DirectX12Queue::DirectX12Queue ( const DirectX12Queue )
delete

◆ DirectX12Queue() [3/3]

LiteFX::Rendering::Backends::DirectX12Queue::DirectX12Queue ( DirectX12Queue &&  )
delete

◆ ~DirectX12Queue()

DirectX12Queue::~DirectX12Queue ( )
virtualnoexcept

Member Function Documentation

◆ bind()

void DirectX12Queue::bind ( )
overridevirtual

Binds the queue on the parent device.

Implements LiteFX::Rendering::ICommandQueue.

◆ createCommandBuffer()

UniquePtr< DirectX12CommandBuffer > DirectX12Queue::createCommandBuffer ( const bool &  beginRecording = false) const
overridevirtual

◆ currentFence()

UInt64 DirectX12Queue::currentFence ( ) const
overridevirtualnoexcept

Returns the value of the latest fence inserted into the queue.

Implements LiteFX::Rendering::ICommandQueue.

◆ device()

const DirectX12Device & DirectX12Queue::device ( ) const
virtualnoexcept

Returns a reference to the device that provides this queue.

Returns
A reference to the queue's parent device.

◆ isBound()

bool DirectX12Queue::isBound ( ) const
overridevirtualnoexcept

Returns true, if the command queue is bound on the parent device.

Implements LiteFX::Rendering::ICommandQueue.

◆ priority()

const QueuePriority & DirectX12Queue::priority ( ) const
overridevirtualnoexcept

Returns the priority of the queue.

Implements LiteFX::Rendering::ICommandQueue.

◆ release()

void DirectX12Queue::release ( )
overridevirtual

Releases the queue from the parent device.

Implements LiteFX::Rendering::ICommandQueue.

◆ submit() [1/2]

UInt64 DirectX12Queue::submit ( const Array< const DirectX12CommandBuffer * > &  commandBuffers) const
overridevirtual

◆ submit() [2/2]

UInt64 DirectX12Queue::submit ( const DirectX12CommandBuffer commandBuffer) const
overridevirtual

◆ type()

const QueueType & DirectX12Queue::type ( ) const
overridevirtualnoexcept

Returns the type of the queue.

Implements LiteFX::Rendering::ICommandQueue.

◆ waitFor()

void DirectX12Queue::waitFor ( const UInt64 fence) const
overridevirtualnoexcept

Waits for a certain fence value to complete on the command queue.

Implements LiteFX::Rendering::ICommandQueue.