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

Implements a Vulkan frame buffer. More...

#include <vulkan.hpp>

Inherits LiteFX::Rendering::FrameBuffer< VulkanCommandBuffer >, and LiteFX::Resource< VkFramebuffer >.

Classes

class  VulkanFrameBufferImpl
 

Public Member Functions

 VulkanFrameBuffer (const VulkanRenderPass &renderPass, const UInt32 &bufferIndex, const Size2d &renderArea, const UInt32 &commandBuffers=1)
 Initializes a Vulkan frame buffer. More...
 
 VulkanFrameBuffer (const VulkanFrameBuffer &) noexcept=delete
 
 VulkanFrameBuffer (VulkanFrameBuffer &&) noexcept=delete
 
virtual ~VulkanFrameBuffer () noexcept
 
virtual const VkSemaphore & semaphore () const noexcept
 Returns a reference of the semaphore, that can be used to signal, that the frame buffer is finished. 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 const VulkanCommandBuffercommandBuffer (const UInt32 &index) const override
 Returns a command buffer that records draw commands for the frame buffer. More...
 
virtual Array< const VulkanCommandBuffer * > commandBuffers () const noexcept override
 
virtual Array< const IVulkanImage * > images () const noexcept override
 
virtual const IVulkanImageimage (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< VulkanCommandBuffer >
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...
 
- Public Member Functions inherited from LiteFX::Resource< VkFramebuffer >
 Resource (const Resource &)=delete
 
 Resource (Resource &&)=delete
 
virtual ~Resource () noexcept=default
 
const VkFramebuffer & handle () const noexcept override
 Returns the resource managed by the class. More...
 
- Public Member Functions inherited from LiteFX::IResource< VkFramebuffer >
virtual ~IResource () noexcept=default
 
virtual const VkFramebuffer & handle () const noexcept=0
 Returns the resource managed by the class. More...
 

Additional Inherited Members

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

Detailed Description

Implements a Vulkan frame buffer.

See also
VulkanRenderPass

Constructor & Destructor Documentation

◆ VulkanFrameBuffer() [1/3]

VulkanFrameBuffer::VulkanFrameBuffer ( const VulkanRenderPass renderPass,
const UInt32 bufferIndex,
const Size2d renderArea,
const UInt32 commandBuffers = 1 
)

Initializes a Vulkan 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.

◆ VulkanFrameBuffer() [2/3]

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

◆ VulkanFrameBuffer() [3/3]

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

◆ ~VulkanFrameBuffer()

VulkanFrameBuffer::~VulkanFrameBuffer ( )
virtualnoexcept

Member Function Documentation

◆ bufferIndex()

const UInt32 & VulkanFrameBuffer::bufferIndex ( ) const
overridevirtualnoexcept

Returns the index of the buffer within the RenderPass.

Implements LiteFX::Rendering::IFrameBuffer.

◆ commandBuffer()

const VulkanCommandBuffer & VulkanFrameBuffer::commandBuffer ( const UInt32 index) const
overridevirtual

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

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

◆ commandBuffers()

Array< const VulkanCommandBuffer * > VulkanFrameBuffer::commandBuffers ( ) const
overridevirtualnoexcept

◆ getHeight()

size_t VulkanFrameBuffer::getHeight ( ) const
overridevirtualnoexcept

Returns the current height of the frame buffer.

Implements LiteFX::Rendering::IFrameBuffer.

◆ getWidth()

size_t VulkanFrameBuffer::getWidth ( ) const
overridevirtualnoexcept

Returns the current width of the frame buffer.

Implements LiteFX::Rendering::IFrameBuffer.

◆ image()

const IVulkanImage & VulkanFrameBuffer::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< VulkanCommandBuffer >.

◆ images()

Array< const IVulkanImage * > VulkanFrameBuffer::images ( ) const
overridevirtualnoexcept

◆ lastFence()

UInt64 & VulkanFrameBuffer::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.

◆ resize()

void VulkanFrameBuffer::resize ( const Size2d renderArea)
overridevirtual

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

Implements LiteFX::Rendering::IFrameBuffer.

◆ semaphore()

const VkSemaphore & VulkanFrameBuffer::semaphore ( ) const
virtualnoexcept

Returns a reference of the semaphore, that can be used to signal, that the frame buffer is finished.

Returns
A reference of the semaphore, that can be used to signal, that the frame buffer is finished.

◆ size()

const Size2d & VulkanFrameBuffer::size ( ) const
overridevirtualnoexcept

Returns the current size of the frame buffer.

Implements LiteFX::Rendering::IFrameBuffer.