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 lookuplogicalDevice— Logical device to retrieve the queue fromqueueType— 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 checkssurface— Surface to present tologicalDevice— 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 checksurface— 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 fromsurface— 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 fromsurface— Surface used for presentation queue selection
Returns — Initialized logical device object