Monado OpenXR Runtime
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
41
42/*
43 *
44 * Functions.
45 *
46 */
47
48/*!
49 * Free all lists allocated by @ref vk_surface_info.
50 */
51void
53
54/*!
55 * Fill in the given @ref vk_surface_info, will allocate lists.
56 */
57XRT_CHECK_RESULT VkResult
58vk_surface_info_fill_in(struct vk_bundle *vk, struct vk_surface_info *info, VkSurfaceKHR surface);
59
60/*!
61 * Print out the gathered information about the
62 * surface given to @ref vk_surface_info_fill_in.
63 */
64void
65vk_print_surface_info(struct vk_bundle *vk, struct vk_surface_info *info, enum u_logging_level log_level);
66
67
68#ifdef __cplusplus
69}
70#endif
u_logging_level
Logging level enum.
Definition: u_logging.h:40
A bundle of Vulkan functions and objects, used by both Compositor and Compositor client code.
Definition: vk_helpers.h:49
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:114