16#ifndef AEONGAMES_VULKANBUFFER_HPP
17#define AEONGAMES_VULKANBUFFER_HPP
18#include <vulkan/vulkan.h>
19#include "aeongames/Buffer.hpp"
31 VulkanBuffer (
const VulkanRenderer& aVulkanRenderer,
const VkDeviceSize aSize,
const VkBufferUsageFlags aUsage,
const VkMemoryPropertyFlags aProperties,
const void *aData =
nullptr );
42 void Initialize (
const VkDeviceSize aSize,
const VkBufferUsageFlags aUsage,
const VkMemoryPropertyFlags aProperties,
const void *aData =
nullptr );
49 void WriteMemory (
const size_t aOffset,
const size_t aSize,
const void *aData =
nullptr ) const final;
50 void*
Map ( const
size_t aOffset,
size_t aSize ) const final;
51 void Unmap() const final;
57 VkBuffer mBuffer{ VK_NULL_HANDLE };
58 VkDeviceMemory mDeviceMemory{ VK_NULL_HANDLE };
60 VkBufferUsageFlags mUsage{};
61 VkMemoryPropertyFlags mProperties{};
Abstract interface for GPU/memory buffer operations.
VulkanBuffer & operator=(const VulkanBuffer &aBuffer)=delete
Assignment operator due to rule of zero/three/five.
VulkanBuffer(const VulkanBuffer &aBuffer)=delete
Copy constructor.
size_t GetSize() const final
Get the total size of the buffer in bytes.
VulkanBuffer(const VulkanRenderer &aVulkanRenderer)
Construct an uninitialized buffer.
void WriteMemory(const size_t aOffset, const size_t aSize, const void *aData=nullptr) const final
Write data into the buffer at a given offset.
void * Map(const size_t aOffset, size_t aSize) const final
Map a region of the buffer into CPU-accessible memory.
void Initialize(const VkDeviceSize aSize, const VkBufferUsageFlags aUsage, const VkMemoryPropertyFlags aProperties, const void *aData=nullptr)
Initialize the buffer with the given size, usage, memory properties, and optional data.
const VkBuffer & GetBuffer() const
Get the underlying Vulkan buffer handle.
void Finalize()
Release the Vulkan buffer and its device memory.
void Unmap() const final
Unmap a previously mapped buffer region.
Vulkan rendering backend implementing the Renderer interface.
<- This is here just for the literals