Monado OpenXR Runtime
xrt_limits.h
Go to the documentation of this file.
1// Copyright 2019-2022, Collabora, Ltd.
2// Copyright 2025, 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 * Max number of views supported by a compositor, artificial limit.
23 */
24#define XRT_MAX_VIEWS 2
25
26/*
27 * System needs to support at least 4 views for stereo with foveated inset.
28 */
29#define XRT_MAX_COMPOSITOR_VIEW_CONFIGS_VIEW_COUNT (XRT_MAX_VIEWS > 4 ? XRT_MAX_VIEWS : 4)
30
31/*
32 * Max number of view configurations a system compositor can support simultaneously.
33 */
34#define XRT_MAX_COMPOSITOR_VIEW_CONFIGS_COUNT 2
35
36/*!
37 * Maximum number of handles sent in one call.
38 */
39#define XRT_MAX_IPC_HANDLES 16
40
41/*!
42 * Max swapchain images, artificial limit.
43 *
44 * Must be smaller or the same as XRT_MAX_IPC_HANDLES.
45 */
46#define XRT_MAX_SWAPCHAIN_IMAGES 8
47
48/*!
49 * Max formats supported by a compositor, artificial limit.
50 */
51#define XRT_MAX_SWAPCHAIN_FORMATS 16
52
53/*!
54 * Max number of plane orientations that can be requested at a time.
55 */
56#define XRT_MAX_PLANE_ORIENTATIONS_EXT 256
57
58/*!
59 * Max number of plane semantic types that can be requested at a time.
60 */
61#define XRT_MAX_PLANE_SEMANTIC_TYPE_EXT 256
62
63/*!
64 * Max formats in the swapchain creation info formats list, artificial limit.
65 */
66#define XRT_MAX_SWAPCHAIN_CREATE_INFO_FORMAT_LIST_COUNT 8
67
68/*!
69 * Max number of supported display refresh rates, artificial limit.
70 */
71#define XRT_MAX_SUPPORTED_REFRESH_RATES 16
72
73/*!
74 * Max number of layers which can be handled at once.
75 */
76#ifdef XRT_OS_ANDROID
77#define XRT_MAX_LAYERS 32
78#elif defined(XRT_OS_LINUX) || defined(XRT_OS_WINDOWS)
79#define XRT_MAX_LAYERS 128
80#else
81#error "Unknown platform, define XRT_MAX_LAYERS for your OS"
82#endif
83
84/*!
85 * @}
86 */
Header holding common defines.
Auto detect OS and certain features.