Monado OpenXR Runtime
xrt_limits.h
Go to the documentation of this file.
1// Copyright 2019-2022, Collabora, Ltd.
2// Copyright 2025-2026, NVIDIA CORPORATION.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief Header for limits of the XRT interfaces.
7 * @author Jakob Bornecrantz <jakob@collabora.com>
8 * @ingroup xrt_iface
9 */
10
11#pragma once
12
13#include "xrt/xrt_config_os.h"
14#include "xrt/xrt_compiler.h"
15
16
17/*!
18 * @addtogroup xrt_iface
19 * @{
20 */
21
22/*!
23 * Maximum number of devices simultaneously usable by an implementation of
24 * @ref xrt_system_devices.
25 */
26#define XRT_SYSTEM_MAX_DEVICES (32)
27
28/*
29 * Max number of views supported by a compositor, artificial limit.
30 */
31#define XRT_MAX_VIEWS 2
32
33/*
34 * System needs to support at least 4 views for stereo with foveated inset.
35 */
36#define XRT_MAX_COMPOSITOR_VIEW_CONFIGS_VIEW_COUNT (XRT_MAX_VIEWS > 4 ? XRT_MAX_VIEWS : 4)
37
38/*
39 * Max number of view configurations a system compositor can support simultaneously.
40 */
41#define XRT_MAX_COMPOSITOR_VIEW_CONFIGS_COUNT 2
42
43/*!
44 * Maximum number of handles sent in one call.
45 */
46#define XRT_MAX_IPC_HANDLES 16
47
48/*!
49 * Max swapchain images, artificial limit.
50 *
51 * Must be smaller or the same as XRT_MAX_IPC_HANDLES.
52 */
53#define XRT_MAX_SWAPCHAIN_IMAGES 8
54
55/*!
56 * Max formats supported by a compositor, artificial limit.
57 */
58#define XRT_MAX_SWAPCHAIN_FORMATS 16
59
60/*!
61 * Max number of plane orientations that can be requested at a time.
62 */
63#define XRT_MAX_PLANE_ORIENTATIONS_EXT 256
64
65/*!
66 * Max number of plane semantic types that can be requested at a time.
67 */
68#define XRT_MAX_PLANE_SEMANTIC_TYPE_EXT 256
69
70/*!
71 * Max formats in the swapchain creation info formats list, artificial limit.
72 */
73#define XRT_MAX_SWAPCHAIN_CREATE_INFO_FORMAT_LIST_COUNT 8
74
75/*!
76 * Max number of supported display refresh rates, artificial limit.
77 */
78#define XRT_MAX_SUPPORTED_REFRESH_RATES 16
79
80/*!
81 * Max number of layers which can be handled at once.
82 */
83#ifdef XRT_OS_ANDROID
84#define XRT_MAX_LAYERS 32
85#elif defined(XRT_OS_LINUX) || defined(XRT_OS_WINDOWS) || defined(XRT_OS_OSX)
86#define XRT_MAX_LAYERS 128
87#else
88#error "Unknown platform, define XRT_MAX_LAYERS for your OS"
89#endif
90
91/*!
92 * @}
93 */
Header holding common defines.
Auto detect OS and certain features.