47 class VULKAN_COMPUTE_API VulkanComputeBuffer
51 ~VulkanComputeBuffer();
59 void allocate(VkDeviceSize byte_size,
bool device_local =
false);
64 void upload(
const void* data, VkDeviceSize byte_size);
69 void download(
void* data, VkDeviceSize byte_size)
const;
75 VkBuffer
buffer()
const {
return m_device_buffer; }
78 VkDeviceSize
byteSize()
const {
return m_byte_size; }
81 bool isAllocated()
const {
return m_device_buffer != VK_NULL_HANDLE; }
90 VkBuffer createBuffer(VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, VkDeviceMemory& memory)
const;
95 void copyBuffer(VkBuffer src, VkBuffer dst, VkDeviceSize size)
const;
99 VkBuffer m_device_buffer = VK_NULL_HANDLE;
100 VkDeviceMemory m_device_memory = VK_NULL_HANDLE;
101 VkBuffer m_staging_buffer = VK_NULL_HANDLE;
102 VkDeviceMemory m_staging_memory = VK_NULL_HANDLE;
103 VkDeviceSize m_byte_size = 0;
104 bool m_device_local =
false;