In Vulkan, buffers don't have their own memory. To be able to use buffers in our application and to store any data inside them, we need to allocate a memory object and bind it to a buffer.
Allocating and binding a memory object for a buffer
How to do it...
- Take the handle of a physical device from which the logical device was created. Store it in a variable of type VkPhysicalDevice named physical_device.
- Create a variable of type VkPhysicalDeviceMemoryProperties named physical_device_memory_properties.
- Call vkGetPhysicalDeviceMemoryProperties( physical_device, &physical_device_memory_properties ), for which provide the handle of a physical device and a pointer to the physical_device_memory_properties variable. This call will store memory parameters (number...