15 const Device* device) : _buffer(buffer), _device(device) {
25 buffer._buffer = VK_NULL_HANDLE;
26 buffer._device =
nullptr;
27 buffer._deviceMemory =
nullptr;
28 buffer._requirements = {};
29 buffer._deviceMemoryOffset = 0;
40 buffer._buffer = VK_NULL_HANDLE;
41 buffer._device =
nullptr;
42 buffer._deviceMemory =
nullptr;
43 buffer._requirements = {};
44 buffer._deviceMemoryOffset = 0;
54 if (
_buffer != VK_NULL_HANDLE) {
55 vkDestroyBuffer(static_cast<VkDevice>(*
_device),
_buffer,
nullptr);
64 vkBindBufferMemory(static_cast<VkDevice>(*
_device), static_cast<VkBuffer>(
_buffer), static_cast<VkDeviceMemory>(deviceMemory), memoryOffset);
74 memcpy(gpuData, data, size);
void bindMemory(const DeviceMemory &deviceMemory, VkDeviceSize memoryOffset=0)
const DeviceMemory * _deviceMemory
VkMemoryRequirements _requirements
VkDeviceMemory _deviceMemory
void * mapBuffer(const API::Buffer &buffer, VkDeviceSize size=VK_WHOLE_SIZE, VkDeviceSize offset=0) const
Buffer & operator=(const Buffer &)=delete
VkDeviceSize _deviceMemoryOffset
bool updateData(const void *data, VkDeviceSize size, VkDeviceSize offset=0) const