Selecting a queue family that supports presentation to a given surface
Displaying an image on screen is performed by submitting a special command to the device's queue. We can't display images using any queues we want or, in other words, we can't submit this operation to any queue. This is because it may not be supported. Image presentation, along with the graphics, compute, transfer, and sparse operations, is another property of a queue family. And similar to all types of operations, not all queues may support it and, more importantly, not even all devices may support it. That's why we need to check what queue family from which physical device allows us to present an image on screen.
How to do it...
- Take the handle of a physical device returned by the
vkEnumeratePhysicalDevices()
function. Store it in a variable of typeVkPhysicalDevice
namedphysical_device
. - Take the created presentation surface and store its handle in a variable of type
VkSurfaceKHR
namedpresentation_surface
. - Create a
std...