Monado OpenXR Runtime
xrt_vulkan_includes.h
Go to the documentation of this file.
1// Copyright 2018-2022, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Include all of the Vulkan headers in one place, and cope with any "messy" includes implied by it.
6 * @author Jakob Bornecrantz <jakob@collabora.com>
7 * @author Rylie Pavlik <rylie.pavlik@collabora.com>
8 * @ingroup xrt_iface
9 */
10
11#pragma once
12
13#include "xrt/xrt_config_vulkan.h"
14#include "xrt/xrt_config_have.h"
15
16#ifdef XRT_HAVE_VULKAN
17// pre-emptively include windows.h if applicable so we can specify our own flags for it.
18#include "xrt/xrt_windows.h"
19
20#define VK_NO_PROTOTYPES
21#include <vulkan/vulkan.h> // IWYU pragma: export
22
23// Dealing with underscore compat.
24#ifndef VK_KHR_MAINTENANCE_1_EXTENSION_NAME
25#define VK_KHR_MAINTENANCE_1_EXTENSION_NAME VK_KHR_MAINTENANCE1_EXTENSION_NAME
26#endif
27#ifndef VK_KHR_MAINTENANCE_2_EXTENSION_NAME
28#define VK_KHR_MAINTENANCE_2_EXTENSION_NAME VK_KHR_MAINTENANCE2_EXTENSION_NAME
29#endif
30#ifndef VK_KHR_MAINTENANCE_3_EXTENSION_NAME
31#define VK_KHR_MAINTENANCE_3_EXTENSION_NAME VK_KHR_MAINTENANCE3_EXTENSION_NAME
32#endif
33#ifndef VK_EXT_SWAPCHAIN_COLORSPACE_EXTENSION_NAME
34#define VK_EXT_SWAPCHAIN_COLORSPACE_EXTENSION_NAME VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME
35#endif
36
37#if defined(VK_USE_PLATFORM_XLIB_XRANDR_EXT) || defined(VK_USE_PLATFORM_XLIB_KHR)
38// the xlib header is notoriously polluting.
39#undef Status
40#undef Bool
41#endif
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
48vkGetInstanceProcAddr(VkInstance instance, const char *pName);
49
50#ifdef __cplusplus
51}
52#endif
53
54#endif // XRT_HAVE_VULKAN
A minimal way to include Windows.h.