Initialising the Queues

Applications submit tasks to queues which are executed asynchronously by the GPU

A graphics queue has already been created alongside the logical device. All that remains to do is to retrieve a handle to this queue from the logical device and store it. This handle will be used later when submitting the command buffers, which contain the render commands, to the queue.

What is a queue?

Applications submit tasks to queues, which are then executed asynchronously by the GPU. They are the primary means by which an application communicates work to the GPU.

The application submits work alongside any synchronisation objects to the queue using commands such as vkQueueSubmit(). This will be seen later on in the guide when it is time to actually draw the frame.

Example: initQueues()

In the example code, initQueues() retrieves the graphics queue using the graphics queue family index found in initQueuesFamilies().

It also checks whether the graphics queue family supports both rendering and presenting operations. If it does, then only a single queue is required for this application, otherwise, another queue has to be retrieved that can perform presenting operations.