A Buffer represents a Vulkan buffer with a size, buffer pointer, and buffer memory.
More...
#include <Buffer.h>
|
| Buffer () |
| Default Ctor for a buffer. More...
|
|
| Buffer (const VkDeviceSize &t_Size, const VkBufferUsageFlags &t_Usage, const VkMemoryPropertyFlags &t_Properties, const void *t_Data=nullptr) |
| Construct a new Buffer object. More...
|
|
| ~Buffer () |
| Destroy the Buffer object, frees Vk memory and destroys buffer. More...
|
|
const VkBuffer & | GetVkBuffer () const |
|
const VkDeviceMemory & | GetVkDeviceMemory () const |
|
const VkDeviceSize & | GetSize () const |
|
void | Release () |
| Destroy the VK buffer object, frees vk memory. More...
|
|
bool | IsUsed () const |
| Check if this buffer's vulkan assets are used. More...
|
|
|
static void | CopyBuffer (Buffer *t_SrcBuffer, Buffer *t_DstBuffer, VkDeviceSize t_Size) |
| Copy the contents of the source buffer to the destintation buffer using a single command. More...
|
|
|
void | MapMemory (void **t_Data) const |
| Map the memory of this buffer to the given data. More...
|
|
void | UnmapMemory () |
| Unmap this bufferes memory from the vulkan device. More...
|
|
A Buffer represents a Vulkan buffer with a size, buffer pointer, and buffer memory.
◆ Buffer() [1/2]
Fling::Buffer::Buffer |
( |
| ) |
|
|
inline |
Default Ctor for a buffer.
Buffer is initalized to 0
◆ Buffer() [2/2]
Fling::Buffer::Buffer |
( |
const VkDeviceSize & |
t_Size, |
|
|
const VkBufferUsageFlags & |
t_Usage, |
|
|
const VkMemoryPropertyFlags & |
t_Properties, |
|
|
const void * |
t_Data = nullptr |
|
) |
| |
Construct a new Buffer object.
- Parameters
-
t_Size | Size of this buffer in bytes |
t_Usage | Vk usage flags for this buffer |
t_Properties | Vk props of this buffer, used to find the memroy type |
t_Data | Pointer to data that this buffer should map to, e.g. a staging buffer (Default = nullptr) |
◆ ~Buffer()
Fling::Buffer::~Buffer |
( |
| ) |
|
Destroy the Buffer object, frees Vk memory and destroys buffer.
◆ CopyBuffer()
void Fling::Buffer::CopyBuffer |
( |
Buffer * |
t_SrcBuffer, |
|
|
Buffer * |
t_DstBuffer, |
|
|
VkDeviceSize |
t_Size |
|
) |
| |
|
static |
Copy the contents of the source buffer to the destintation buffer using a single command.
- Parameters
-
t_SrcBuffer | Source buffer data |
t_DstBuffer | Destination buffer data |
t_Size | Size of the data to copy |
◆ GetSize()
const VkDeviceSize& Fling::Buffer::GetSize |
( |
| ) |
const |
|
inline |
◆ GetVkBuffer()
const VkBuffer& Fling::Buffer::GetVkBuffer |
( |
| ) |
const |
|
inline |
◆ GetVkDeviceMemory()
const VkDeviceMemory& Fling::Buffer::GetVkDeviceMemory |
( |
| ) |
const |
|
inline |
◆ IsUsed()
bool Fling::Buffer::IsUsed |
( |
| ) |
const |
|
inline |
Check if this buffer's vulkan assets are used.
- Returns
- true memory is not null and the size is greater than 0
◆ MapMemory()
void Fling::Buffer::MapMemory |
( |
void ** |
t_Data | ) |
const |
|
private |
Map the memory of this buffer to the given data.
- Parameters
-
t_Data | Where to map this buffer's data to |
◆ Release()
void Fling::Buffer::Release |
( |
| ) |
|
Destroy the VK buffer object, frees vk memory.
◆ UnmapMemory()
void Fling::Buffer::UnmapMemory |
( |
| ) |
|
|
private |
Unmap this bufferes memory from the vulkan device.
◆ m_Buffer
VkBuffer Fling::Buffer::m_Buffer |
|
private |
Vulkan logical buffer object.
◆ m_BufferMemory
VkDeviceMemory Fling::Buffer::m_BufferMemory |
|
private |
Pointer to the physcial device memory for this buffer.
◆ m_Size
VkDeviceSize Fling::Buffer::m_Size |
|
private |
The size of this buffer in bytes.
The documentation for this class was generated from the following files: