Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
DataBuffer.h
Go to the documentation of this file.
1#pragma once
2
3#include <vulkan/vulkan.h>
4#include <vk_mem_alloc.h>
5
6class Context;
7
8namespace EngineCore {
9 class DataBuffer final
10 {
11 public:
12 DataBuffer(VkDevice device,
13 VkPhysicalDevice physicalDevice,
14 VmaAllocator allocator,
15 VkBufferUsageFlags bufferUsageFlags,
16 VkMemoryPropertyFlags memoryProperties,
17 VkDeviceSize size);
19
20 bool copyTo(const DataBuffer& target, VkCommandBuffer commandBuffer, VkQueue queue) const;
21 void* map() const;
22 void unmap() const;
23
24 VkBuffer getBuffer() const;
25
26 private:
27
28 VkDevice device = nullptr;
29 VkPhysicalDevice physicalDevice = nullptr;
30 VmaAllocator allocator_ = VK_NULL_HANDLE;
31
32 VkBuffer buffer = nullptr;
33 VmaAllocation allocation_ = VK_NULL_HANDLE;
34 VkDeviceSize size = 0u;
35 };
36}
VmaAllocation allocation_
Definition DataBuffer.h:33
DataBuffer(VkDevice device, VkPhysicalDevice physicalDevice, VmaAllocator allocator, VkBufferUsageFlags bufferUsageFlags, VkMemoryPropertyFlags memoryProperties, VkDeviceSize size)
Definition DataBuffer.cpp:8
VkBuffer getBuffer() const
bool copyTo(const DataBuffer &target, VkCommandBuffer commandBuffer, VkQueue queue) const
VkPhysicalDevice physicalDevice
Definition DataBuffer.h:29
VmaAllocator allocator_
Definition DataBuffer.h:30
Log category system implementation.