Monado OpenXR Runtime
Loading...
Searching...
No Matches
vk_surface_info.h
Go to the documentation of this file.
1// Copyright 2019-2023, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Helper for getting information from a VkSurfaceKHR.
6 * @author Jakob Bornecrantz <jakob@collabora.com>
7 * @ingroup aux_vk
8 */
9
10#pragma once
11
12#include "vk/vk_helpers.h"
13
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19
20/*
21 *
22 * Struct(s).
23 *
24 */
25
27{
28 VkPresentModeKHR *present_modes;
29 VkSurfaceFormatKHR *formats;
30
31 uint32_t present_mode_count;
32 uint32_t format_count;
33
34 VkSurfaceCapabilitiesKHR caps;
35
36#ifdef VK_EXT_display_surface_counter
37 VkSurfaceCapabilities2EXT caps2;
38#endif
39
40#ifdef VK_KHR_get_surface_capabilities2
41#ifdef VK_KHR_present_id2
42 VkSurfaceCapabilitiesPresentId2KHR present_id2_caps;
43#endif
44
45#ifdef VK_KHR_present_wait2
46 VkSurfaceCapabilitiesPresentWait2KHR present_wait2_caps;
47#endif
48
49#ifdef VK_KHR_shared_presentable_image
50 VkSharedPresentSurfaceCapabilitiesKHR shared_present_caps;
51#endif
52#endif
53};
54
55
56/*
57 *
58 * Functions.
59 *
60 */
61
62/*!
63 * Free all lists allocated by @ref vk_surface_info.
64 */
65void
67
68/*!
69 * Fill in the given @ref vk_surface_info, will allocate lists.
70 */
71XRT_CHECK_RESULT VkResult
72vk_surface_info_fill_in(struct vk_bundle *vk, struct vk_surface_info *info, VkSurfaceKHR surface);
73
74/*!
75 * Print out the gathered information about the
76 * surface given to @ref vk_surface_info_fill_in.
77 */
78void
79vk_print_surface_info(struct vk_bundle *vk, struct vk_surface_info *info, enum u_logging_level log_level);
80
81
82#ifdef __cplusplus
83}
84#endif
u_logging_level
Logging level enum.
Definition u_logging.h:45
A bundle of Vulkan functions and objects, used by both Compositor and Compositor client code.
Definition vk_helpers.h:81
Definition vk_surface_info.h:27
Common Vulkan code header.
XRT_CHECK_RESULT VkResult vk_surface_info_fill_in(struct vk_bundle *vk, struct vk_surface_info *info, VkSurfaceKHR surface)
Fill in the given vk_surface_info, will allocate lists.
Definition vk_surface_info.c:65
void vk_surface_info_destroy(struct vk_surface_info *info)
Free all lists allocated by vk_surface_info.
Definition vk_surface_info.c:47
void vk_print_surface_info(struct vk_bundle *vk, struct vk_surface_info *info, enum u_logging_level log_level)
Print out the gathered information about the surface given to vk_surface_info_fill_in.
Definition vk_surface_info.c:174