SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
spark::render::vk::VulkanIndexBuffer Class Referencefinal

Vulkan implementation of an IIndexBuffer. More...

#include <VulkanIndexBuffer.h>

Inheritance diagram for spark::render::vk::VulkanIndexBuffer:
spark::render::vk::VulkanBuffer spark::render::vk::IVulkanIndexBuffer spark::render::vk::IVulkanBuffer spark::render::Resource< VkBuffer > spark::render::StateResource spark::render::vk::IVulkanBuffer spark::render::IIndexBuffer spark::render::IBuffer spark::render::IResource< VkBuffer > spark::render::IResource< VkBuffer > spark::render::IStateResource spark::render::IBuffer spark::render::IResource< VkBuffer > spark::render::IBuffer spark::render::IStateResource spark::render::IMappable spark::render::IDeviceMemory spark::render::IStateResource spark::render::IMappable spark::render::IDeviceMemory spark::render::IStateResource spark::render::IMappable spark::render::IDeviceMemory

Classes

struct  Impl
 

Public Member Functions

 VulkanIndexBuffer (VkBuffer buffer, const VulkanIndexBufferLayout &layout, unsigned elements, const VmaAllocator &allocator, const VmaAllocation &allocation, const std::string &name="")
 
 VulkanIndexBuffer (const VulkanIndexBuffer &other)=delete
 
 VulkanIndexBuffer (VulkanIndexBuffer &&other) noexcept=delete
 
VulkanIndexBufferoperator= (const VulkanIndexBuffer &other)=delete
 
VulkanIndexBufferoperator= (VulkanIndexBuffer &&other) noexcept=delete
 
const VulkanIndexBufferLayoutlayout () const noexcept override
 Gets the layout of the buffer.
 
- Public Member Functions inherited from spark::render::vk::VulkanBuffer
 VulkanBuffer (VkBuffer buffer, BufferType type, unsigned elements, std::size_t element_size, std::size_t alignment, bool writable, const VmaAllocator &allocator, const VmaAllocation &allocation, const std::string &name)
 
 VulkanBuffer (const VulkanBuffer &other)=delete
 
 VulkanBuffer (VulkanBuffer &&other) noexcept=delete
 
VulkanBufferoperator= (const VulkanBuffer &other)=delete
 
VulkanBufferoperator= (VulkanBuffer &&other) noexcept=delete
 
BufferType type () const override
 Gets the type of the buffer.
 
unsigned elements () const noexcept override
 Get the number of sub-resources in the memory chunk.
 
std::size_t size () const noexcept override
 Gets the size (in bytes) of the memory chunk.
 
std::size_t elementSize () const noexcept override
 Gets the size (in bytes) of one element in the memory chunk. If there is only one element, this equals the result of IDeviceMemory::size().
 
std::size_t elementAlignment () const override
 Gets the alignment of one element in the memory chunk.
 
std::size_t alignedElementSize () const noexcept override
 Gets the real size (in bytes) of the memory chunk.
 
bool writable () const noexcept override
 Checks if the resource can be bound to a read/write descriptor.
 
void map (const void *data, std::size_t size, unsigned element) override
 Maps the memory at data into the internal memory of the object.
 
void map (std::span< const void * > data, std::size_t element_size, unsigned first_element) override
 Maps the memory at data into the internal memory of the object.
 
void map (void *data, size_t size, unsigned element, bool write) override
 Maps the memory at data into the internal memory of the object.
 
void map (std::span< void * > data, size_t element_size, unsigned first_element, bool write) override
 Maps the memory at data into the internal memory of the object.
 
- Public Member Functions inherited from spark::render::IMappable
virtual void map (const void *data, std::size_t size, unsigned int element)=0
 Maps the memory at data into the internal memory of the object.
 
virtual void map (std::span< const void * > data, std::size_t element_size, unsigned int first_element)=0
 Maps the memory blocks within data into the internal memory of the object.
 
virtual void map (void *data, size_t size, unsigned int element=0, bool write=true)=0
 Maps the memory at data into the internal memory of the object.
 
virtual void map (std::span< void * > data, size_t element_size, unsigned int first_element=0, bool write=true)=0
 Maps the memory blocks within data into the internal memory of the object.
 
- Public Member Functions inherited from spark::render::Resource< VkBuffer >
 Resource (VkBuffer handle) noexcept
 Initializes the managed resource with the given handle.
 
 Resource (const Resource &other)=delete
 
 Resource (Resource &&other) noexcept=delete
 
Resourceoperator= (const Resource &other)=delete
 
Resourceoperator= (Resource &&other) noexcept=delete
 
const VkBuffer & handle () const final
 Gets the managed resource handle.
 
- Public Member Functions inherited from spark::render::StateResource
 StateResource (std::string_view name) noexcept
 Initializes a new StateResource instance.
 
 StateResource (const StateResource &other)=delete
 
 StateResource (StateResource &&other) noexcept
 
StateResourceoperator= (const StateResource &other)=delete
 
StateResourceoperator= (StateResource &&other) noexcept
 
const std::string & name () const noexcept final
 Gets the name of the state resource.
 

Static Public Member Functions

static std::unique_ptr< IVulkanIndexBufferAllocate (const VulkanIndexBufferLayout &layout, unsigned elements, const VmaAllocator &allocator, const VkBufferCreateInfo &create_info, const VmaAllocationCreateInfo &allocation_info, VmaAllocationInfo *allocation_result=nullptr)
 
static std::unique_ptr< IVulkanIndexBufferAllocate (const std::string &name, const VulkanIndexBufferLayout &layout, unsigned elements, const VmaAllocator &allocator, const VkBufferCreateInfo &create_info, const VmaAllocationCreateInfo &allocation_info, VmaAllocationInfo *allocation_result=nullptr)
 
- Static Public Member Functions inherited from spark::render::vk::VulkanBuffer
static std::unique_ptr< IVulkanBufferAllocate (BufferType type, unsigned elements, std::size_t element_size, std::size_t alignment, bool writable, const VmaAllocator &allocator, const VkBufferCreateInfo &create_info, const VmaAllocationCreateInfo &allocation_info, VmaAllocationInfo *allocation_result=nullptr)
 
static std::unique_ptr< IVulkanBufferAllocate (const std::string &name, BufferType type, unsigned elements, std::size_t element_size, std::size_t alignment, bool writable, const VmaAllocator &allocator, const VkBufferCreateInfo &create_info, const VmaAllocationCreateInfo &allocation_info, VmaAllocationInfo *allocation_result=nullptr)
 

Additional Inherited Members

- Public Types inherited from spark::render::IResource< VkBuffer >
using handle_type
 
- Public Types inherited from spark::render::vk::IVulkanIndexBuffer
using index_buffer_layout_type = VulkanIndexBufferLayout
 
- Protected Member Functions inherited from spark::render::Resource< VkBuffer >
VkBuffer & handle () final
 Gets the managed resource handle.
 
- Protected Member Functions inherited from spark::render::StateResource
 StateResource () noexcept
 Initializes a new StateResource instance with an empty name.
 
std::string & name () noexcept
 Gets the name of the state resource.
 

Detailed Description

Vulkan implementation of an IIndexBuffer.

Constructor & Destructor Documentation

◆ VulkanIndexBuffer()

spark::render::vk::VulkanIndexBuffer::VulkanIndexBuffer ( VkBuffer buffer,
const VulkanIndexBufferLayout & layout,
unsigned elements,
const VmaAllocator & allocator,
const VmaAllocation & allocation,
const std::string & name = "" )
explicit
Parameters
buffer
layout
elements
allocator
allocation
name

Member Function Documentation

◆ Allocate() [1/2]

std::unique_ptr< IVulkanIndexBuffer > spark::render::vk::VulkanIndexBuffer::Allocate ( const std::string & name,
const VulkanIndexBufferLayout & layout,
unsigned elements,
const VmaAllocator & allocator,
const VkBufferCreateInfo & create_info,
const VmaAllocationCreateInfo & allocation_info,
VmaAllocationInfo * allocation_result = nullptr )
static
Parameters
name
layout
elements
allocator
create_info
allocation_info
allocation_result
Returns

◆ Allocate() [2/2]

std::unique_ptr< IVulkanIndexBuffer > spark::render::vk::VulkanIndexBuffer::Allocate ( const VulkanIndexBufferLayout & layout,
unsigned elements,
const VmaAllocator & allocator,
const VkBufferCreateInfo & create_info,
const VmaAllocationCreateInfo & allocation_info,
VmaAllocationInfo * allocation_result = nullptr )
static
Parameters
layout
elements
allocator
create_info
allocation_info
allocation_result
Returns

◆ layout()

const VulkanIndexBufferLayout & spark::render::vk::VulkanIndexBuffer::layout ( ) const
nodiscardoverridevirtualnoexcept

Gets the layout of the buffer.

Returns
The layout of the buffer.

Implements spark::render::IIndexBuffer.