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

Implements a DirectX 12 frame buffer. More...

#include <dx12.hpp>

Inherits LiteFX::Rendering::FrameBuffer< DirectX12CommandBuffer >.

Classes

class  DirectX12FrameBufferImpl
 

Public Member Functions

 DirectX12FrameBuffer (const DirectX12RenderPass &renderPass, const UInt32 &bufferIndex, const Size2d &renderArea, const UInt32 &commandBuffers=1)
 Initializes a DirectX 12 frame buffer. More...
 
 DirectX12FrameBuffer (const DirectX12FrameBuffer &) noexcept=delete
 
 DirectX12FrameBuffer (DirectX12FrameBuffer &&) noexcept=delete
 
virtual ~DirectX12FrameBuffer () noexcept
 
virtual ID3D12DescriptorHeap * renderTargetHeap () const noexcept
 Returns a pointer to the descriptor heap that allocates the render targets for this frame buffer. More...
 
virtual ID3D12DescriptorHeap * depthStencilTargetHeap () const noexcept
 Returns a pointer to the descriptor heap that allocates the depth/stencil views for this frame buffer. More...
 
virtual const UInt32renderTargetDescriptorSize () const noexcept
 Returns the size of a descriptor for a render target within the frame buffer. More...
 
virtual const UInt32depthStencilTargetDescriptorSize () const noexcept
 Returns the size of a descriptor for a depth/stencil view within the frame buffer. More...
 
virtual UInt64lastFence () const noexcept
 Returns a reference of the last fence value for the frame buffer. More...
 
virtual const UInt32bufferIndex () const noexcept override
 Returns the index of the buffer within the RenderPass. More...
 
virtual const Size2dsize () const noexcept override
 Returns the current size of the frame buffer. More...
 
virtual size_t getWidth () const noexcept override
 Returns the current width of the frame buffer. More...
 
virtual size_t getHeight () const noexcept override
 Returns the current height of the frame buffer. More...
 
virtual Array< const DirectX12CommandBuffer * > commandBuffers () const noexcept override
 
virtual const DirectX12CommandBuffercommandBuffer (const UInt32 &index) const override
 Returns a command buffer that records draw commands for the frame buffer. More...
 
virtual Array< const IDirectX12Image * > images () const noexcept override
 
virtual const IDirectX12Imageimage (const UInt32 &location) const override
 Returns the image that stores the output attachment for the render target mapped the location passed with location . More...
 
virtual void resize (const Size2d &renderArea) override
 Causes the frame buffer to be invalidated and recreated with a new size. More...
 
- Public Member Functions inherited from LiteFX::Rendering::FrameBuffer< DirectX12CommandBuffer >
virtual ~FrameBuffer () noexcept=default
 
virtual Array< const command_buffer_type * > commandBuffers () const noexcept=0
 
virtual const command_buffer_typecommandBuffer (const UInt32 &index) const=0
 Returns a command buffer that records draw commands for the frame buffer. More...
 
virtual Array< const image_type * > images () const noexcept=0
 
virtual const image_typeimage (const UInt32 &location) const=0
 Returns the image that stores the output attachment for the render target mapped the location passed with location . More...
 
- Public Member Functions inherited from LiteFX::Rendering::IFrameBuffer
virtual ~IFrameBuffer () noexcept=default
 
virtual const UInt32bufferIndex () const noexcept=0
 Returns the index of the buffer within the RenderPass. More...
 
virtual const Size2dsize () const noexcept=0
 Returns the current size of the frame buffer. More...
 
virtual size_t getWidth () const noexcept=0
 Returns the current width of the frame buffer. More...
 
virtual size_t getHeight () const noexcept=0
 Returns the current height of the frame buffer. More...
 
Array< const ICommandBuffer * > commandBuffers () const noexcept
 Returns all command buffers, the frame buffer stores. More...
 
virtual const ICommandBuffercommandBuffer (const UInt32 &index) const =0
 Returns a command buffer that records draw commands for the frame buffer. More...
 
Array< const IImage * > images () const noexcept
 Returns the images that store the output attachments for the render targets of the RenderPass. More...
 
virtual const IImageimage (const UInt32 &location) const =0
 Returns the image that stores the output attachment for the render target mapped the location passed with location . More...
 
virtual void resize (const Size2d &renderArea)=0
 Causes the frame buffer to be invalidated and recreated with a new size. More...
 

Additional Inherited Members

- Public Types inherited from LiteFX::Rendering::FrameBuffer< DirectX12CommandBuffer >
using command_buffer_type = DirectX12CommandBuffer
 
using image_type = command_buffer_type::image_type
 

Detailed Description

Implements a DirectX 12 frame buffer.

See also
DirectX12RenderPass

Constructor & Destructor Documentation

◆ DirectX12FrameBuffer() [1/3]

DirectX12FrameBuffer::DirectX12FrameBuffer ( const DirectX12RenderPass renderPass,
const UInt32 bufferIndex,
const Size2d renderArea,
const UInt32 commandBuffers = 1 
)

Initializes a DirectX 12 frame buffer.

Parameters
renderPassThe parent render pass of the frame buffer.
bufferIndexThe index of the frame buffer within the parent render pass.
renderAreaThe initial size of the render area.
commandBuffersThe number of command buffers, the frame buffer stores.

◆ DirectX12FrameBuffer() [2/3]

LiteFX::Rendering::Backends::DirectX12FrameBuffer::DirectX12FrameBuffer ( const DirectX12FrameBuffer )
deletenoexcept

◆ DirectX12FrameBuffer() [3/3]

LiteFX::Rendering::Backends::DirectX12FrameBuffer::DirectX12FrameBuffer ( DirectX12FrameBuffer &&  )
deletenoexcept

◆ ~DirectX12FrameBuffer()

DirectX12FrameBuffer::~DirectX12FrameBuffer ( )
virtualdefaultnoexcept

Member Function Documentation

◆ bufferIndex()

const UInt32 & DirectX12FrameBuffer::bufferIndex ( ) const
overridevirtualnoexcept

Returns the index of the buffer within the RenderPass.

Implements LiteFX::Rendering::IFrameBuffer.

◆ commandBuffer()

const DirectX12CommandBuffer & DirectX12FrameBuffer::commandBuffer ( const UInt32 index) const
overridevirtual

Returns a command buffer that records draw commands for the frame buffer.

Implements LiteFX::Rendering::FrameBuffer< DirectX12CommandBuffer >.

◆ commandBuffers()

Array< const DirectX12CommandBuffer * > DirectX12FrameBuffer::commandBuffers ( ) const
overridevirtualnoexcept

◆ depthStencilTargetDescriptorSize()

const UInt32 & DirectX12FrameBuffer::depthStencilTargetDescriptorSize ( ) const
virtualnoexcept

Returns the size of a descriptor for a depth/stencil view within the frame buffer.

Returns
The size of a descriptor for a depth/stencil view within the frame buffer.
See also
depthStencilTargetHeap

◆ depthStencilTargetHeap()

ID3D12DescriptorHeap * DirectX12FrameBuffer::depthStencilTargetHeap ( ) const
virtualnoexcept

Returns a pointer to the descriptor heap that allocates the depth/stencil views for this frame buffer.

Note that it is typically not supported to have more than one depth/stencil output view bound to a RenderPass.

Returns
A pointer to the descriptor heap that allocates the depth/stencil views for this frame buffer.
See also
renderTargetHeap, depthStencilDescriptorSize

◆ getHeight()

size_t DirectX12FrameBuffer::getHeight ( ) const
overridevirtualnoexcept

Returns the current height of the frame buffer.

Implements LiteFX::Rendering::IFrameBuffer.

◆ getWidth()

size_t DirectX12FrameBuffer::getWidth ( ) const
overridevirtualnoexcept

Returns the current width of the frame buffer.

Implements LiteFX::Rendering::IFrameBuffer.

◆ image()

const IDirectX12Image & DirectX12FrameBuffer::image ( const UInt32 location) const
overridevirtual

Returns the image that stores the output attachment for the render target mapped the location passed with location .

Implements LiteFX::Rendering::FrameBuffer< DirectX12CommandBuffer >.

◆ images()

Array< const IDirectX12Image * > DirectX12FrameBuffer::images ( ) const
overridevirtualnoexcept

◆ lastFence()

UInt64 & DirectX12FrameBuffer::lastFence ( ) const
virtualnoexcept

Returns a reference of the last fence value for the frame buffer.

The frame buffer must only be re-used, if this fence is reached in the graphics queue.

Returns
A reference of the last fence value for the frame buffer.

◆ renderTargetDescriptorSize()

const UInt32 & DirectX12FrameBuffer::renderTargetDescriptorSize ( ) const
virtualnoexcept

Returns the size of a descriptor for a render target within the frame buffer.

Returns
The size of a descriptor for a render target within the frame buffer.
See also
renderTargetHeap

◆ renderTargetHeap()

ID3D12DescriptorHeap * DirectX12FrameBuffer::renderTargetHeap ( ) const
virtualnoexcept

Returns a pointer to the descriptor heap that allocates the render targets for this frame buffer.

Returns
A pointer to the descriptor heap that allocates the render targets for this frame buffer.
See also
depthStencilTargetHeap, renderTargetDescriptorSize

◆ resize()

void DirectX12FrameBuffer::resize ( const Size2d renderArea)
overridevirtual

Causes the frame buffer to be invalidated and recreated with a new size.

Implements LiteFX::Rendering::IFrameBuffer.

◆ size()

const Size2d & DirectX12FrameBuffer::size ( ) const
overridevirtualnoexcept

Returns the current size of the frame buffer.

Implements LiteFX::Rendering::IFrameBuffer.