Monado OpenXR Runtime
Loading...
Searching...
No Matches
vk_format.h
Go to the documentation of this file.
1// Copyright 2026, Beyley Cardellio
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Vulkan helpers for formats.
6 *
7 * @author Beyley Cardellio <ep1cm1n10n123@gmail.com>
8 * @ingroup aux_vk
9 */
10
11#pragma once
12
13#include "xrt/xrt_compiler.h"
15
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21
22/*!
23 * A pair of a UNORM and sRGB format.
24 *
25 * @ingroup aux_vk
26 */
28{
29 VkFormat unorm;
30 VkFormat srgb;
31};
32
33/*!
34 * Given a UNORM format, return the corresponding sRGB format.
35 *
36 * @param unorm The UNORM format to convert.
37 * @return The corresponding sRGB format, or VK_FORMAT_UNDEFINED if the input format is not recognized.
38 *
39 * @ingroup aux_vk
40 */
41VkFormat
43
44/*!
45 * Given an sRGB format, return the corresponding UNORM format.
46 *
47 * @param srgb The sRGB format to convert.
48 * @return The corresponding UNORM format, or VK_FORMAT_UNDEFINED if the input format is not recognized.
49 *
50 * @ingroup aux_vk
51 */
52VkFormat
54
55
56#ifdef __cplusplus
57}
58#endif
VkFormat vk_format_convert_unorm_to_srgb(VkFormat unorm)
Given a UNORM format, return the corresponding sRGB format.
Definition vk_format.c:70
VkFormat vk_format_convert_srgb_to_unorm(VkFormat srgb)
Given an sRGB format, return the corresponding UNORM format.
Definition vk_format.c:82
A pair of a UNORM and sRGB format.
Definition vk_format.h:28
Header holding common defines.
Include all of the Vulkan headers in one place, and cope with any "messy" includes implied by it.