Presenting Images to the Screen

Setting up the presentation infrastructure

Following the initial setup where the instance, physical, and logical devices have been created, it is time to start creating the infrastructure which allows images to be presented on screen. The basic elements of this are the swapchain images, which are the final render targets of the application and are the objects that are presented to the surface.

The steps of this stage are as follows:

  1. Create a surface
    • The final rendered images are presented to a surface so they can be displayed on the screen.
  2. Create a swapchain
    • A swapchain manages the images that are going to be rendered and presented to the surface
    • Creation involves several steps including fetching the supported surface formats from the physical device, getting the surface capabilities, and selecting a supported presentation mode for the swapchain.
  3. Initialise all the images created as part of the swapchain. For each image create an associated image view
    • Image views need to be created in order to make any use of the previously created image objects.
    • Creation involves specifying the properties of the image and the image object itself

This section will explain, in further detail, the purpose of these objects and how to create each of them in Vulkan.