Chronos 0.0
A advanced 2D rendering and animation system
|
Used to store buffers in GPU. More...
#include <buffers.hpp>
Public Member Functions | |
void | create (Chronos::Engine::Device device, VkBufferUsageFlags flags, VkMemoryPropertyFlags properties) |
This is used to initialize the buffer. | |
void | copy (void *data, VkCommandPool commandPool) |
Copies the data to the buffer. | |
void | destroy () |
Destroys the buffer and frees the memory. | |
Public Attributes | |
VkBuffer | buffer |
The buffer. | |
VkDeviceSize | size |
The size of the buffer. | |
VkDeviceMemory | memory |
The device memory of the buffer. | |
Private Attributes | |
Chronos::Engine::Device | device |
The device on which the buffer is stored. | |
Used to store buffers in GPU.
It contains the buffer, the size and the memory variables needed for this, along with the appropriate functions to use them.
Definition at line 39 of file buffers.hpp.
void Chronos::Engine::Buffer::copy | ( | void * | data, |
VkCommandPool | commandPool | ||
) |
Copies the data to the buffer.
It does this by coping the data into a temporary staging buffer and then copying it to the final buffer.
data | The data to copy. |
commandPool | The command pool to use for the staging buffer and commands during the copy. |
Definition at line 39 of file buffers.cpp.
References Chronos::Engine::copyBuffer(), Chronos::Engine::createBuffer(), and LOG.
void Chronos::Engine::Buffer::create | ( | Chronos::Engine::Device | device, |
VkBufferUsageFlags | flags, | ||
VkMemoryPropertyFlags | properties | ||
) |
This is used to initialize the buffer.
It is calls the createBuffer function for this purpose and stores the results.
device | The device on which the buffer should be stored. |
flags | The flags to use for the buffer. @params properties The memory properties to use for the buffer. |
Definition at line 27 of file buffers.cpp.
References buffer, Chronos::Engine::createBuffer(), device, LOG, memory, and size.
void Chronos::Engine::Buffer::destroy | ( | ) |
Destroys the buffer and frees the memory.
Definition at line 63 of file buffers.cpp.
References LOG.
VkBuffer Chronos::Engine::Buffer::buffer |
The buffer.
Definition at line 78 of file buffers.hpp.
|
private |
The device on which the buffer is stored.
Definition at line 94 of file buffers.hpp.
VkDeviceMemory Chronos::Engine::Buffer::memory |
The device memory of the buffer.
Definition at line 88 of file buffers.hpp.
VkDeviceSize Chronos::Engine::Buffer::size |
The size of the buffer.
Definition at line 83 of file buffers.hpp.