Allocating and binding a memory object to an image
Images, similarly to buffers, are not created with a bound memory storage. We need to implicitly create a memory object and bind it to the image. We can also use an existing memory object for this purpose.
How to do it...
- Take the handle of a physical device from which a logical device was created. Store it in a variable of type
VkPhysicalDevice
namedphysical_device
. - Create a variable of type
VkPhysicalDeviceMemoryProperties
namedphysical_device_memory_properties
. - Call
vkGetPhysicalDeviceMemoryProperties( physical_device, &physical_device_memory_properties )
, for which provide the handle of the physical device and a pointer to thephysical_device_memory_properties
variable. This call will store memory parameters (number of heaps, their size, and types) of the physical device used for processing submitted operations. - Take the handle of a logical device created from the physical device, represented by the
physical_device
variable. Store the...