vOOlkan
An object oriented approach to Vulkan
Vulkan::Buffers::UniformBuffer Class Reference

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>

Inheritance diagram for Vulkan::Buffers::UniformBuffer:
Vulkan::Buffers::Buffer

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...
 
- Public Member Functions inherited from Vulkan::Buffers::Buffer
template<std::same_as< VkMemoryPropertyFlagBits >... P>
 Buffer (const LogicalDevice &virtualGpu, const PhysicalDevice &realGpu, size_t size, int usage, P... requiredMemoryProperties)
 
 Buffer (const Buffer &)=delete
 
Bufferoperator= (const Buffer &)=delete
 
 Buffer (Buffer &&)=default
 
Bufferoperator= (Buffer &&)=default
 
 ~Buffer ()
 
const VkBuffer & operator+ () const
 
VkDeviceMemory & getBufferMemory ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Vulkan::Buffers::Buffer
template<std::same_as< VkMemoryPropertyFlagBits >... P>
static uint32_t findSuitableMemoryIndex (const PhysicalDevice &realGpu, uint32_t suitableTypesBitmask, P... requiredMemoryProperties)
 
- Protected Member Functions inherited from Vulkan::Buffers::Buffer
void createBuffer (const LogicalDevice &virtualGpu, size_t size, int usage)
 
void allocateMemory (uint32_t memoryIndex, VkDeviceSize sizeToAllocate)
 
- Protected Attributes inherited from Vulkan::Buffers::Buffer
VkBuffer buffer
 
VkDeviceMemory bufferMemory
 
const LogicalDevicevirtualGpu
 
const size_t size
 

Detailed Description

This buffer is used to store the uniform data (such as matrices) to be used by the shaders in the GPU.

Constructor & Destructor Documentation

◆ UniformBuffer()

Vulkan::Buffers::UniformBuffer::UniformBuffer ( const LogicalDevice virtualGpu,
const PhysicalDevice realGpu,
size_t  size 
)
inline

Member Function Documentation

◆ fillBuffer()

template<typename D >
void Vulkan::Buffers::UniformBuffer::fillBuffer ( const D &  data,
int  offset = 0 
)
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}.

Parameters
...datafloats to insert into the buffer.

The documentation for this class was generated from the following file: