UgDevice

Logical device creation and queue access

It

Logical device handle together with its queues and properties

struct It {
  VkDevice handle;
  VkPhysicalDeviceProperties properties;
  VkQueue graphicQueue;
  VkQueue presentQueue;
};

getQueue

Retrieve a queue of a specific type from the logical device

VkQueue getQueue(VkPhysicalDevice device, VkDevice logicalDevice, VkQueueFlagBits queueType);

Parameters

  • device — Physical device used during queue family lookup
  • logicalDevice — Logical device to retrieve the queue from
  • queueType — Queue capability flag identifying the desired queue

Returns — Queue handle


getPresentationQueue

Retrieve the presentation queue from the logical device

VkQueue getPresentationQueue(VkPhysicalDevice device, VkSurfaceKHR surface, VkDevice logicalDevice);

Parameters

  • device — Physical device used for surface support checks
  • surface — Surface to present to
  • logicalDevice — Logical device to retrieve the queue from

Returns — Presentation queue handle


getSurfaceSupport

Check whether a physical device supports presentation to a surface

U32 getSurfaceSupport(VkPhysicalDevice device, VkSurfaceKHR surface);

Parameters

  • device — Physical device to check
  • surface — Surface to check presentation support for

Returns — Non-zero queue family index if supported


destroy

Destroy the logical device

U0 destroy(UgDevice.It& device);

Parameters

  • device — Logical device to destroy

make

Create the raw VkDevice without wrapping it

VkDevice make(VkPhysicalDevice device, VkSurfaceKHR surface);

Parameters

  • device — Physical device to create from
  • surface — Surface used for presentation queue selection

Returns — Raw logical device handle


create

Create the logical device and populate queue handles

UgDevice.It create(VkPhysicalDevice device, VkSurfaceKHR surface);

Parameters

  • device — Physical device to create from
  • surface — Surface used for presentation queue selection

Returns — Initialized logical device object