When we create a swapchain, we need to specify creation parameters. But we can't choose whatever values we want. We must provide values that fit into supported limits, which can be obtained from a presentation surface. So in order to properly create a swapchain, we need to acquire the surface's capabilities.
Getting the capabilities of a presentation surface
How to do it...
- Take the handle of a selected physical device enumerated using the vkEnumeratePhysicalDevices() function and store it in a variable of type VkPhysicalDevice named physical_device.
- Take the handle of a created presentation surface. Store it in a variable of type VkSurfaceKHR named presentation_surface.
- Create a variable of type VkSurfaceCapabilitiesKHR named surface_capabilities.
- Call...