vOOlkan
An object oriented approach to Vulkan
|
This buffer is used to store the uniform data (such as matrices) to be used by the shaders in the GPU. More...
#include <UniformBuffer.h>
Public Member Functions | |
UniformBuffer (const LogicalDevice &virtualGpu, const PhysicalDevice &realGpu, size_t size) | |
template<typename D > | |
void | fillBuffer (const D &data, int offset=0) |
Fills the buffer with the specified data. More... | |
![]() | |
template<std::same_as< VkMemoryPropertyFlagBits >... P> | |
Buffer (const LogicalDevice &virtualGpu, const PhysicalDevice &realGpu, size_t size, int usage, P... requiredMemoryProperties) | |
Buffer (const Buffer &)=delete | |
Buffer & | operator= (const Buffer &)=delete |
Buffer (Buffer &&)=default | |
Buffer & | operator= (Buffer &&)=default |
~Buffer () | |
const VkBuffer & | operator+ () const |
VkDeviceMemory & | getBufferMemory () |
Additional Inherited Members | |
![]() | |
template<std::same_as< VkMemoryPropertyFlagBits >... P> | |
static uint32_t | findSuitableMemoryIndex (const PhysicalDevice &realGpu, uint32_t suitableTypesBitmask, P... requiredMemoryProperties) |
![]() | |
void | createBuffer (const LogicalDevice &virtualGpu, size_t size, int usage) |
void | allocateMemory (uint32_t memoryIndex, VkDeviceSize sizeToAllocate) |
![]() | |
VkBuffer | buffer |
VkDeviceMemory | bufferMemory |
const LogicalDevice & | virtualGpu |
const size_t | size |
This buffer is used to store the uniform data (such as matrices) to be used by the shaders in the GPU.
|
inline |
|
inline |
Fills the buffer with the specified data.
Each argument vector is padded. The minimum alignment of the GPU used to build this buffer is used. For example if the alignment is 4 and the arguments are {2, 2, 2}, {3, 3} then the buffer will have this layout: {2, 2, 2, 0, 3, 3, 0, 0}.
...data | floats to insert into the buffer. |