Vulkan's index buffer class, used in agnostic Mesh instance.
More...
#include <VulkanBuffer.h>
|
| VulkanIndexBuffer (uint32_t *indices, uint32_t count) |
| Constructor.
|
|
virtual | ~VulkanIndexBuffer () |
| Destructor involving destruction of index buffer and freeing up of memory.
|
|
virtual void | Bind () const override |
| Not useful for Vulkan API atm.
|
|
virtual void | UnBind () const override |
| Not useful for Vulkan API atm.
|
|
void | CreateBuffer (VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, VkBuffer &buffer, VkDeviceMemory &bufferMemory) |
| Actual creation of buffer using Vulkan API. Memory is also allocated appropriately.
|
|
void | CopyBuffer (VkBuffer srcBuffer, VkBuffer dstBuffer, VkDeviceSize size) |
| Copy buffer.
|
|
uint32_t | FindMemoryType (uint32_t typeFilter, VkMemoryPropertyFlags properties) |
| Finds appropriate memory type with demanded properties. Basically a loop is run from counter i = 0 to VkPhysicalDeviceMemoryProperties.memoryTypeCount (number of valid elements in the memoryTypes array) and memoryType[i] is queried for appropriate properties. On condition satisfaction, counter i is returned.
|
|
virtual uint32_t | GetCount () const override |
| Getter for the number of vertices to draw.
|
|
VkBuffer | GetIndexBuffer () const |
| Getter for indexbuffer.
|
|
VkDeviceMemory | GetIndexBufferMemory () const |
| Getter for index buffer memory.
|
|
size_t | GetBufferSize () |
| Getter for indexbuffer size in bytes.
|
|
|
static IndexBuffer * | Create (uint32_t *vertices, uint32_t size) |
|
Vulkan's index buffer class, used in agnostic Mesh instance.
- Since
- Karma 1.0.0
◆ VulkanIndexBuffer()
Karma::VulkanIndexBuffer::VulkanIndexBuffer |
( |
uint32_t * | indices, |
|
|
uint32_t | count ) |
Constructor.
Initializes the relevant buffers and uploads them to GPU.
- Parameters
-
indices | The array of floats containing indexbuffer data |
count | The length of the indexbuffer array |
- See also
- VulkanVertexBuffer::VulkanVertexBuffer for the role played by the staging buffer.
- Since
- Karma 1.0.0
◆ ~VulkanIndexBuffer()
Karma::VulkanIndexBuffer::~VulkanIndexBuffer |
( |
| ) |
|
|
virtual |
Destructor involving destruction of index buffer and freeing up of memory.
- Since
- Karma 1.0.0
◆ Bind()
void Karma::VulkanIndexBuffer::Bind |
( |
| ) |
const |
|
overridevirtual |
Not useful for Vulkan API atm.
- Todo
- Ponder over Vulkan equivalent of glBindBuffer
- Since
- Karma 1.0.0
Implements Karma::IndexBuffer.
◆ CopyBuffer()
void Karma::VulkanIndexBuffer::CopyBuffer |
( |
VkBuffer | srcBuffer, |
|
|
VkBuffer | dstBuffer, |
|
|
VkDeviceSize | size ) |
Copy buffer.
- Parameters
-
srcBuffer | The source buffer to copy data from |
dstBuffer | The destination buffer to copy data to |
size | The total size of data in bytes |
- Since
- Karma 1.0.0
◆ CreateBuffer()
void Karma::VulkanIndexBuffer::CreateBuffer |
( |
VkDeviceSize | size, |
|
|
VkBufferUsageFlags | usage, |
|
|
VkMemoryPropertyFlags | properties, |
|
|
VkBuffer & | buffer, |
|
|
VkDeviceMemory & | bufferMemory ) |
Actual creation of buffer using Vulkan API. Memory is also allocated appropriately.
- Parameters
-
size | The size (in bytes) of the buffer object to be created |
usage | The bitmask of VkBufferUsageFlagBits (https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkBufferUsageFlagBits.html) specifying allowed usages of the buffer. |
properties | The bitmask of VkMemoryPropertyFlagBits of properties for this memory type of the buffer. |
buffer | The pointer to a VkBuffer handle in which the resulting buffer object is returned. |
bufferMemory | The pointer to a VkDeviceMemory handle in which information about the allocated memory is returned. |
- Since
- Karma 1.0.0
◆ FindMemoryType()
uint32_t Karma::VulkanIndexBuffer::FindMemoryType |
( |
uint32_t | typeFilter, |
|
|
VkMemoryPropertyFlags | properties ) |
Finds appropriate memory type with demanded properties. Basically a loop is run from counter i = 0 to VkPhysicalDeviceMemoryProperties.memoryTypeCount (number of valid elements in the memoryTypes array) and memoryType[i] is queried for appropriate properties. On condition satisfaction, counter i is returned.
- Parameters
-
- Returns
- Memory type index i
- Since
- Karma 1.0.0
◆ GetBufferSize()
size_t Karma::VulkanIndexBuffer::GetBufferSize |
( |
| ) |
|
|
inline |
Getter for indexbuffer size in bytes.
- Since
- Karma 1.0.0
◆ GetCount()
virtual uint32_t Karma::VulkanIndexBuffer::GetCount |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ GetIndexBuffer()
VkBuffer Karma::VulkanIndexBuffer::GetIndexBuffer |
( |
| ) |
const |
|
inline |
Getter for indexbuffer.
- Since
- Karma 1.0.0
◆ GetIndexBufferMemory()
VkDeviceMemory Karma::VulkanIndexBuffer::GetIndexBufferMemory |
( |
| ) |
const |
|
inline |
Getter for index buffer memory.
- Since
- Karma 1.0.0
◆ UnBind()
void Karma::VulkanIndexBuffer::UnBind |
( |
| ) |
const |
|
overridevirtual |
Not useful for Vulkan API atm.
- Todo
- Ponder over Vulkan equivalent of glBindBuffer
- Since
- Karma 1.0.0
Implements Karma::IndexBuffer.
The documentation for this class was generated from the following files:
- Karma/src/Platform/Vulkan/VulkanBuffer.h
- Karma/src/Platform/Vulkan/VulkanBuffer.cpp