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

Implements a Vulkan IVertexBuffer. More...

#include <buffer.h>

Inherits LiteFX::Rendering::Backends::VulkanBuffer, and LiteFX::Rendering::Backends::IVulkanVertexBuffer.

Classes

class  VulkanVertexBufferImpl
 

Public Member Functions

 VulkanVertexBuffer (VkBuffer buffer, const VulkanVertexBufferLayout &layout, const UInt32 &elements, const ResourceState &initialState, const VmaAllocator &allocator, const VmaAllocation &allocation, const String &name="")
 
 VulkanVertexBuffer (VulkanVertexBuffer &&)=delete
 
 VulkanVertexBuffer (const VulkanVertexBuffer &)=delete
 
virtual ~VulkanVertexBuffer () noexcept
 
const VulkanVertexBufferLayoutlayout () const noexcept override
 Gets the layout of the vertex buffer. More...
 
- Public Member Functions inherited from LiteFX::Rendering::Backends::VulkanBuffer
 VulkanBuffer (VkBuffer buffer, const BufferType &type, const UInt32 &elements, const size_t &elementSize, const size_t &alignment, const bool &writable, const ResourceState &initialState, const VmaAllocator &allocator, const VmaAllocation &allocation, const String &name)
 
 VulkanBuffer (VulkanBuffer &&)=delete
 
 VulkanBuffer (const VulkanBuffer &)=delete
 
virtual ~VulkanBuffer () noexcept
 
virtual const BufferType & type () const noexcept override
 Returns the type of the buffer. More...
 
virtual const UInt32elements () const noexcept override
 Gets the number of sub-resources inside the memory chunk. More...
 
virtual size_t size () const noexcept override
 Gets the size (in bytes) of the aligned memory chunk. More...
 
virtual size_t elementSize () const noexcept override
 Returns the size of a single element within the buffer. If there is only one element, this is equal to size. More...
 
virtual size_t elementAlignment () const noexcept override
 Returns the alignment of a single element. More...
 
virtual size_t alignedElementSize () const noexcept override
 Returns the actual size of the element in device memory. More...
 
virtual const bool & writable () const noexcept override
 Returns true, if the resource can be bound to a read/write descriptor. More...
 
virtual const ResourceState & state (const UInt32 &subresource=0) const override
 Returns the current state of the resource. More...
 
virtual ResourceState & state (const UInt32 &subresource=0) override
 Returns a reference of the current state of the resource. More...
 
virtual void map (const void *const data, const size_t &size, const UInt32 &element=0) override
 Maps the memory at data to the internal memory of this object. More...
 
virtual void map (Span< const void *const > data, const size_t &elementSize, const UInt32 &firstElement=0) override
 Maps the memory blocks within data to the internal memory of an array. More...
 
- Public Member Functions inherited from LiteFX::Rendering::Backends::IVulkanBuffer
virtual ~IVulkanBuffer () noexcept=default
 
- Public Member Functions inherited from LiteFX::Rendering::IBuffer
virtual ~IBuffer () noexcept=default
 
virtual const BufferType & type () const noexcept=0
 Returns the type of the buffer. More...
 
- Public Member Functions inherited from LiteFX::Rendering::IDeviceMemory
virtual ~IDeviceMemory () noexcept=default
 
virtual const UInt32elements () const noexcept=0
 Gets the number of sub-resources inside the memory chunk. More...
 
virtual size_t size () const noexcept=0
 Gets the size (in bytes) of the aligned memory chunk. More...
 
virtual size_t elementSize () const noexcept=0
 Returns the size of a single element within the buffer. If there is only one element, this is equal to size. More...
 
virtual size_t elementAlignment () const noexcept=0
 Returns the alignment of a single element. More...
 
virtual size_t alignedElementSize () const noexcept=0
 Returns the actual size of the element in device memory. More...
 
virtual const bool & writable () const noexcept=0
 Returns true, if the resource can be bound to a read/write descriptor. More...
 
virtual const ResourceState & state (const UInt32 &subresource=0) const =0
 Returns the current state of the resource. More...
 
virtual ResourceState & state (const UInt32 &subresource=0)=0
 Returns a reference of the current state of the resource. More...
 
- Public Member Functions inherited from LiteFX::Rendering::IMappable
virtual ~IMappable () noexcept=default
 
virtual void map (const void *const data, const size_t &size, const UInt32 &element=0)=0
 Maps the memory at data to the internal memory of this object. More...
 
virtual void map (Span< const void *const > data, const size_t &elementSize, const UInt32 &firstElement=0)=0
 Maps the memory blocks within data to the internal memory of an array. More...
 
- Public Member Functions inherited from LiteFX::Rendering::IStateResource
virtual ~IStateResource () noexcept=default
 
virtual const Stringname () const noexcept=0
 Returns the name of the resource. More...
 
- Public Member Functions inherited from LiteFX::IResource< VkBuffer >
virtual ~IResource () noexcept=default
 
virtual const VkBuffer & handle () const noexcept=0
 Returns the resource managed by the class. More...
 
- Public Member Functions inherited from LiteFX::Resource< VkBuffer >
 Resource (const Resource &)=delete
 
 Resource (Resource &&)=delete
 
virtual ~Resource () noexcept=default
 
const VkBuffer & handle () const noexcept override
 Returns the resource managed by the class. More...
 
- Public Member Functions inherited from LiteFX::Rendering::StateResource
 StateResource (StringView name)
 Initializes a new state resource instance. More...
 
 StateResource (StateResource &&)=delete
 
 StateResource (const StateResource &)=delete
 
virtual ~StateResource () noexcept
 
virtual const Stringname () const noexcept override
 Returns the name of the resource. More...
 
- Public Member Functions inherited from LiteFX::Rendering::Backends::IVulkanVertexBuffer
virtual ~IVulkanVertexBuffer () noexcept=default
 
- Public Member Functions inherited from LiteFX::Rendering::VertexBuffer< VulkanVertexBufferLayout >
virtual ~VertexBuffer () noexcept=default
 
virtual const vertex_buffer_layout_typelayout () const noexcept=0
 Gets the layout of the vertex buffer. More...
 
- Public Member Functions inherited from LiteFX::Rendering::IVertexBuffer
virtual ~IVertexBuffer () noexcept=default
 
virtual const IVertexBufferLayoutlayout () const noexcept=0
 Gets the layout of the vertex buffer. More...
 

Static Public Member Functions

static UniquePtr< IVulkanVertexBufferallocate (const VulkanVertexBufferLayout &layout, const UInt32 &elements, const ResourceState &initialState, const VmaAllocator &allocator, const VkBufferCreateInfo &createInfo, const VmaAllocationCreateInfo &allocationInfo, VmaAllocationInfo *allocationResult=nullptr)
 
static UniquePtr< IVulkanVertexBufferallocate (const String &name, const VulkanVertexBufferLayout &layout, const UInt32 &elements, const ResourceState &initialState, const VmaAllocator &allocator, const VkBufferCreateInfo &createInfo, const VmaAllocationCreateInfo &allocationInfo, VmaAllocationInfo *allocationResult=nullptr)
 
- Static Public Member Functions inherited from LiteFX::Rendering::Backends::VulkanBuffer
static UniquePtr< IVulkanBufferallocate (const BufferType &type, const UInt32 &elements, const size_t &elementSize, const size_t &alignment, const bool &writable, const ResourceState &initialState, const VmaAllocator &allocator, const VkBufferCreateInfo &createInfo, const VmaAllocationCreateInfo &allocationInfo, VmaAllocationInfo *allocationResult=nullptr)
 
static UniquePtr< IVulkanBufferallocate (const String &name, const BufferType &type, const UInt32 &elements, const size_t &elementSize, const size_t &alignment, const bool &writable, const ResourceState &initialState, const VmaAllocator &allocator, const VkBufferCreateInfo &createInfo, const VmaAllocationCreateInfo &allocationInfo, VmaAllocationInfo *allocationResult=nullptr)
 

Additional Inherited Members

- Public Types inherited from LiteFX::Rendering::VertexBuffer< VulkanVertexBufferLayout >
using vertex_buffer_layout_type = VulkanVertexBufferLayout
 
virtual VkBuffer & handle () noexcept=0
 Returns the resource managed by the class. More...
 
- Protected Member Functions inherited from LiteFX::Resource< VkBuffer >
 Resource (const VkBuffer handle) noexcept
 Initializes the managed resource. More...
 
VkBuffer & handle () noexcept override
 Returns the resource managed by the class. More...
 
- Protected Member Functions inherited from LiteFX::Rendering::StateResource
 StateResource () noexcept
 
Stringname () noexcept
 

Detailed Description

Implements a Vulkan IVertexBuffer.

Constructor & Destructor Documentation

◆ VulkanVertexBuffer() [1/3]

VulkanVertexBuffer::VulkanVertexBuffer ( VkBuffer  buffer,
const VulkanVertexBufferLayout layout,
const UInt32 elements,
const ResourceState &  initialState,
const VmaAllocator &  allocator,
const VmaAllocation &  allocation,
const String name = "" 
)
explicit

◆ VulkanVertexBuffer() [2/3]

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

◆ VulkanVertexBuffer() [3/3]

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

◆ ~VulkanVertexBuffer()

VulkanVertexBuffer::~VulkanVertexBuffer ( )
virtualdefaultnoexcept

Member Function Documentation

◆ allocate() [1/2]

UniquePtr< IVulkanVertexBuffer > VulkanVertexBuffer::allocate ( const String name,
const VulkanVertexBufferLayout layout,
const UInt32 elements,
const ResourceState &  initialState,
const VmaAllocator &  allocator,
const VkBufferCreateInfo &  createInfo,
const VmaAllocationCreateInfo &  allocationInfo,
VmaAllocationInfo *  allocationResult = nullptr 
)
static

◆ allocate() [2/2]

UniquePtr< IVulkanVertexBuffer > VulkanVertexBuffer::allocate ( const VulkanVertexBufferLayout layout,
const UInt32 elements,
const ResourceState &  initialState,
const VmaAllocator &  allocator,
const VkBufferCreateInfo &  createInfo,
const VmaAllocationCreateInfo &  allocationInfo,
VmaAllocationInfo *  allocationResult = nullptr 
)
static

◆ layout()

const VulkanVertexBufferLayout & VulkanVertexBuffer::layout ( ) const
overridevirtualnoexcept

Gets the layout of the vertex buffer.

Implements LiteFX::Rendering::VertexBuffer< VulkanVertexBufferLayout >.