Buffer class for managing Vulkan buffers. This class handles the creation and destruction of buffers, as well as basic memory management.
More...
#include <Buffer.h>
|
MANDRILL_API | Buffer (ptr< Device > pDevice, VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties) |
| Create a new buffer.
|
|
MANDRILL_API | ~Buffer () |
| Destructor for buffer.
|
|
MANDRILL_API void | copyFromHost (const void *pData, VkDeviceSize size, VkDeviceSize offset=0) |
| Copy data from host to the buffer. If the buffer was not created to have host-coherent memory, a staging buffer will be used to transfer the data.
|
|
MANDRILL_API VkBuffer | getBuffer () const |
| Get the buffer handle.
|
|
MANDRILL_API VkDeviceMemory | getMemory () const |
| Get the memory handle.
|
|
MANDRILL_API VkBufferUsageFlags | getUsage () const |
| Get the buffer usage flags.
|
|
MANDRILL_API VkMemoryPropertyFlags | getProperties () const |
| Get the memory property flags.
|
|
MANDRILL_API VkDeviceAddress | getDeviceAddress () const |
| Get the device address of the buffer.
|
|
MANDRILL_API void * | getHostMap () const |
| If the buffer memory is host-coherent, this returns the pointor to the memory.
|
|
MANDRILL_API VkDeviceSize | getSize () const |
| Get the size of the buffer in bytes.
|
|
Buffer class for managing Vulkan buffers. This class handles the creation and destruction of buffers, as well as basic memory management.
◆ Buffer()
Buffer::Buffer |
( |
ptr< Device > |
pDevice, |
|
|
VkDeviceSize |
size, |
|
|
VkBufferUsageFlags |
usage, |
|
|
VkMemoryPropertyFlags |
properties |
|
) |
| |
Create a new buffer.
- Parameters
-
pDevice | Device to use |
size | Size of buffer in bytes |
usage | How the buffer will be used |
properties | What properties the memory should have |
◆ copyFromHost()
void Buffer::copyFromHost |
( |
const void * |
pData, |
|
|
VkDeviceSize |
size, |
|
|
VkDeviceSize |
offset = 0 |
|
) |
| |
Copy data from host to the buffer. If the buffer was not created to have host-coherent memory, a staging buffer will be used to transfer the data.
- Parameters
-
pData | Data to copy |
size | Size of data to copy in bytes |
offset | Offset into the buffer where to place the data |
- Returns
◆ getBuffer()
MANDRILL_API VkBuffer Mandrill::Buffer::getBuffer |
( |
| ) |
const |
|
inline |
Get the buffer handle.
- Returns
- Vulkan buffer handle
◆ getDeviceAddress()
MANDRILL_API VkDeviceAddress Mandrill::Buffer::getDeviceAddress |
( |
| ) |
const |
|
inline |
Get the device address of the buffer.
- Returns
- A vulkan device address
◆ getHostMap()
MANDRILL_API void * Mandrill::Buffer::getHostMap |
( |
| ) |
const |
|
inline |
If the buffer memory is host-coherent, this returns the pointor to the memory.
- Returns
- Pointer to buffer memory, or nullptr
◆ getMemory()
MANDRILL_API VkDeviceMemory Mandrill::Buffer::getMemory |
( |
| ) |
const |
|
inline |
Get the memory handle.
- Returns
- Vulkan device memory handle
◆ getProperties()
MANDRILL_API VkMemoryPropertyFlags Mandrill::Buffer::getProperties |
( |
| ) |
const |
|
inline |
Get the memory property flags.
- Returns
- Memory property flags
◆ getSize()
MANDRILL_API VkDeviceSize Mandrill::Buffer::getSize |
( |
| ) |
const |
|
inline |
Get the size of the buffer in bytes.
- Returns
- Size of the buffer
◆ getUsage()
MANDRILL_API VkBufferUsageFlags Mandrill::Buffer::getUsage |
( |
| ) |
const |
|
inline |
Get the buffer usage flags.
- Returns
- Usage flags
The documentation for this class was generated from the following files:
- /home/runner/work/Mandrill/Mandrill/src/Buffer.h
- /home/runner/work/Mandrill/Mandrill/src/Buffer.cpp