You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
755 B

#pragma once
#include <vulkan/vulkan_core.h>
#include <stdexcept>
5 months ago
#include "vertex.hpp"
#include "vk_mem_alloc.h"
class Instance;
5 months ago
class CommandPool;
class Buffer {
public:
explicit Buffer(VkDeviceSize size, VkBufferUsageFlags bufferUsage,
VmaMemoryUsage memoryUsage, VmaAllocationCreateFlags flags);
explicit Buffer(VkDeviceSize size, void* data, VkDeviceSize dataSize, VkBufferUsageFlags bufferUsage,
VmaMemoryUsage memoryUsage, VmaAllocationCreateFlags flags);
~Buffer();
5 months ago
VkBuffer handle = VK_NULL_HANDLE;
VmaAllocation allocation = VK_NULL_HANDLE;
VmaAllocationInfo allocationInfo {};
5 months ago
VkDeviceSize size;
4 months ago
Buffer(const Buffer& other) = delete;
Buffer& operator =(const Buffer& other) = delete;
private:
void copyTo(Buffer* dst);
};