Initialising the Swapchain Images

An image view is a description of the parameters of an image

A set of images were created alongside the swapchain, but the application still needs to create a corresponding set of image views in order to use them.

What is an image view?

An image view is a description of the parameters of an image. It describes what the image is and how to access it. All images must have an associated image view and an image is always accessed through its image view rather than directly.

An image view stores the following information:

  • A handle to its image.
  • The view type, such as 2D, 3D, or cubemap.
  • The image format.
  • Any remapping of the image's colour components. For example, setting the red component of the image to the value of the green component.
  • The purpose of the image - as in colour, depth, or stencil.
  • The number of mipmap levels and layers.

Example: initImagesAndViews()

In the example code, the application retrieves the newly-created images from the swapchain and iterates through them creating an image view for each. These images are set to be 2D colour render targets, with no mipmapping and only a single layer. There is also no remapping of colour components.