Devices and Queues

Queues are the main method by which an application communicates with a GPU

Physical devices

After creating an instance, the application needs to select a physical device. A physical device represents a piece of hardware installed in the system, most commonly a single GPU. The application can retrieve a list of the available physical devices and select the one which has the properties and features which most closely matches the application's requirements. These properties and features can be simply things like whether the device is integrated or discrete, or something more complex like the maximum size of the pool of push constant memory.

Queues and queue families

Once a physical device has been selected, the device needs to be queried for available queues. In Vulkan, all commands need to be executed on queues. Each device makes a set of queues available which can execute certain operations such as compute, rendering, presenting, and so on.

Queues that share certain properties, for instance those used to execute the same type of operation, are grouped together into queue families. In order to use queues, a queue family which supports the desired operations of the application needs to be selected. For example, if the application needs to render anything, a queue family which supports rendering operations should be selected.

Logical devices

After the physical device and queue family have been selected, they can be used to generate a logical device handle. A logical device is the main interface between the GPU (physical device) and the application and is required for the creation of most objects. It can be used to create the queues that will be used to render and present images. A logical device is often referenced when calling the creation function of many objects.