Monado OpenXR Runtime
Loading...
Searching...
No Matches
comp_settings.h
Go to the documentation of this file.
1// Copyright 2019, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Settings struct for compositor header.
6 * @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7 * @author Jakob Bornecrantz <jakob@collabora.com>
8 * @ingroup comp_main
9 */
10
11#pragma once
12
13#include "xrt/xrt_device.h"
14#include "xrt/xrt_compositor.h"
16
17#include "util/u_logging.h"
18
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24
25/*!
26 * Since NVidia direct mode lets us 'acquire' any display, we need to
27 * be careful about which displays we attempt to acquire.
28 * We may wish to allow user configuration to extend this list.
29 */
30XRT_MAYBE_UNUSED static const char *NV_DIRECT_ALLOWLIST[] = {
31 "Sony SIE HMD *08", // PSVR
32 "HTC Corporation HTC-VIVE", // HTC Vive
33 "HTC Corporation VIVE Pro", // HTC Vive Pro
34 "Oculus VR Inc. Rift", // DK1, DK2 and CV1
35 "Valve Corporation Index HMD", // Valve Index
36 "Seiko/Epson SEC144A", // Samsung Odyssey+
37 "HPN", // Reverb G2
38 "Bigscreen, Inc. Beyond", // Bigscreen Beyond
39 "PNP", // NorthStar (Generic)
40};
41
42/*!
43 * Settings for the compositor.
44 *
45 * @ingroup comp_main
46 */
48{
49 int display;
50
51 bool use_compute;
52
53 VkFormat formats[XRT_MAX_SWAPCHAIN_FORMATS];
54 uint32_t format_count;
55
56 VkColorSpaceKHR color_space;
57 VkPresentModeKHR present_mode;
58
59 //! Preferred window type to use, not actual used.
60 const char *target_identifier;
61
62 //! display string forced by user or NULL
63 const char *nvidia_display;
64
65 //! vk display number to use when forcing vk_display
67
68 struct
69 {
70 uint32_t width;
71 uint32_t height;
72 } preferred;
73
74 //! Percentage to scale the viewport by.
76
77 //! Not used with direct mode.
79
80 //! Logging level.
82
83 //! Print information about available modes for direct mode.
85
86 //! Nominal frame interval
88
89 //! Vulkan physical device selected by comp_settings_check_vulkan_caps
90 //! may be forced by user
92
93 //! Vulkan physical device index for clients to use, forced by user
95
96
97 //! Vulkan device UUID selected by comp_settings_check_vulkan_caps, valid across Vulkan instances
99
100 //! Vulkan device UUID to suggest to clients
102
103 //! The Windows LUID for the GPU device suggested for D3D clients, never changes.
105
106 //! Whether @ref client_gpu_deviceLUID is valid
108
109 //! Try to choose the mode with this index for direct mode
111};
112
113/*!
114 * Initialize the settings struct with either defaults or loaded setting.
115 *
116 * @ingroup comp_main
117 */
118void
119comp_settings_init(struct comp_settings *s, struct xrt_device *xdev);
120
121
122#ifdef __cplusplus
123}
124#endif
static XRT_MAYBE_UNUSED const char * NV_DIRECT_ALLOWLIST[]
Since NVidia direct mode lets us 'acquire' any display, we need to be careful about which displays we...
Definition comp_settings.h:30
u_logging_level
Logging level enum.
Definition u_logging.h:45
void comp_settings_init(struct comp_settings *s, struct xrt_device *xdev)
Initialize the settings struct with either defaults or loaded setting.
Definition comp_settings.c:63
#define XRT_MAX_SWAPCHAIN_FORMATS
Max formats supported by a compositor, artificial limit.
Definition xrt_limits.h:58
Settings for the compositor.
Definition comp_settings.h:48
int client_gpu_index
Vulkan physical device index for clients to use, forced by user.
Definition comp_settings.h:94
int vk_display
vk display number to use when forcing vk_display
Definition comp_settings.h:66
const char * target_identifier
Preferred window type to use, not actual used.
Definition comp_settings.h:60
bool print_modes
Print information about available modes for direct mode.
Definition comp_settings.h:84
xrt_uuid_t selected_gpu_deviceUUID
Vulkan device UUID selected by comp_settings_check_vulkan_caps, valid across Vulkan instances.
Definition comp_settings.h:98
xrt_luid_t client_gpu_deviceLUID
The Windows LUID for the GPU device suggested for D3D clients, never changes.
Definition comp_settings.h:104
int selected_gpu_index
Vulkan physical device selected by comp_settings_check_vulkan_caps may be forced by user.
Definition comp_settings.h:91
int desired_mode
Try to choose the mode with this index for direct mode.
Definition comp_settings.h:110
const char * nvidia_display
display string forced by user or NULL
Definition comp_settings.h:63
bool client_gpu_deviceLUID_valid
Whether client_gpu_deviceLUID is valid.
Definition comp_settings.h:107
bool fullscreen
Not used with direct mode.
Definition comp_settings.h:78
enum u_logging_level log_level
Logging level.
Definition comp_settings.h:81
xrt_uuid_t client_gpu_deviceUUID
Vulkan device UUID to suggest to clients.
Definition comp_settings.h:101
double viewport_scale
Percentage to scale the viewport by.
Definition comp_settings.h:75
int64_t nominal_frame_interval_ns
Nominal frame interval.
Definition comp_settings.h:87
A single HMD or input device.
Definition xrt_device.h:310
To transport LUIDs between different APIs.
Definition xrt_defines.h:63
To transport UUIDs between different APIs.
Definition xrt_defines.h:39
Basic logging functionality.
Header declaring XRT graphics interfaces.
Header defining an xrt display or controller device.
Include all of the Vulkan headers in one place, and cope with any "messy" includes implied by it.