Monado OpenXR Runtime
vk_queue_family.h
Go to the documentation of this file.
1// Copyright 2019-2025, Collabora, Ltd.
2// Copyright 2025-2026, NVIDIA CORPORATION.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief Vulkan queue family helpers.
7 * @author Korcan Hussein <korcan.hussein@collabora.com>
8 * @author Jakob Bornecrantz <tbornecrantz@nvidia.com>
9 * @ingroup aux_vk
10 */
11
12#pragma once
13
14#include "vk/vk_helpers.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20
21/*!
22 * A queue family with its properties and index.
23 *
24 * @ingroup aux_vk
25 */
27{
28 VkQueueFamilyProperties queue_family;
29 uint32_t family_index;
30};
31
32/*!
33 * Find the first graphics queue family.
34 *
35 * @param vk The Vulkan bundle to find the queue family for.
36 * @param out_graphics_queue_family The queue family to return.
37 * @return VK_SUCCESS if the queue family was found, otherwise an error code.
38 */
39VkResult
40vk_queue_family_find_graphics(struct vk_bundle *vk, struct vk_queue_family *out_graphics_queue_family);
41
42/*!
43 * Find a queue family with the given flags, preferring queues without graphics.
44 *
45 * @param vk The Vulkan bundle to find the queue family for.
46 * @param required_flags The flags that must be supported by the queue family.
47 * @param out_queue_family The queue family to return.
48 * @return VK_SUCCESS if the queue family was found, otherwise an error code.
49 */
50VkResult
52 VkQueueFlags required_flags,
53 struct vk_queue_family *out_queue_family);
54
55
56#ifdef __cplusplus
57}
58#endif
A bundle of Vulkan functions and objects, used by both Compositor and Compositor client code.
Definition: vk_helpers.h:75
A queue family with its properties and index.
Definition: vk_queue_family.h:27
Common Vulkan code header.
VkResult vk_queue_family_find_graphics(struct vk_bundle *vk, struct vk_queue_family *out_graphics_queue_family)
Find the first graphics queue family.
Definition: vk_queue_family.c:25
VkResult vk_queue_family_find_and_avoid_graphics(struct vk_bundle *vk, VkQueueFlags required_flags, struct vk_queue_family *out_queue_family)
Find a queue family with the given flags, preferring queues without graphics.
Definition: vk_queue_family.c:68