Initialising a Physical Device

A physical device is an object representation of a GPU

The application needs to select which rendering hardware it is going to use. Vulkan uses the concept of a physical device to represent this hardware in the application.

What is a physical device?

A physical device is an object representation of the GPU that the application will be using. It can be queried for the properties and features of the GPU. These include:

  • device type such as whether it is discrete or integrated
  • device limits such as the maximum allowed image dimensions
  • support for features such as geometry and tessellation shaders

The properties and features of physical devices can be used to filter the available GPUs, based on the application's requirements.

Example: initPhysicalDevice()

In the example code, the application retrieves a list of all physical devices (GPUs) available to the instance, and then iterates through them retrieving their properties. The only requirement is that the GPU is either discrete or integrated so any GPU that is found will be selected. The physical device is selected in the function initPhysicalDevice().