Selecting the Extensions

Extensions provide additional functionality to the Vulkan API beyond the core specification

Extensions provide additional functionality to the Vulkan API beyond the core specification.

They are divided into two categories:

  • Device-level extensions - functionality from these extensions affects device-level objects such as logical devices, queues, and command buffers.
  • Instance-level extensions - functionality from these extensions affects instance-level objects such as instances or physical devices.

As Vulkan does not make any assumptions about the type or purpose of the application, some fairly key functionality for graphics applications can be found in extensions.

The two vital extensions for any Vulkan graphics applications are:

  • VK_KHR_SURFACE_EXTENSION_NAME (instance-level extension) - provides functionality related to surface objects, which are the objects to which rendered images are presented.
  • VK_KHR_SWAPCHAIN_EXTENSION_NAME (device-level extension) - provides functionality related to the swapchain, which manages the application's set of backbuffer images and controls how they are presented to the surface.
Note: There will be greater explanation of devices, instances, queues, command buffers, surfaces and swapchains in the coming sections.

In addition to the general surface extension, a platform-specific extension is required to interface with native windowing systems. This is again because of Vulkan's design - it is intended to be platform agnostic so it has no in-built functionality for dealing with platform-specific issues.

Example: initInstanceExtensions() and initDeviceExtensions()

In the example code, the functions initInstanceExtensions() and initDeviceExtensions() handle the selection of the required instance-level and device-level extensions. The only extensions required for this basic application are the ones mentioned above: swapchain, surface, and a platform-specific surface one.