Monado OpenXR Runtime
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 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 
22 /*!
23  * Since NVidia direct mode lets us 'acquire' any display, we need to
24  * be careful about which displays we attempt to acquire.
25  * We may wish to allow user configuration to extend this list.
26  */
27 XRT_MAYBE_UNUSED static const char *NV_DIRECT_WHITELIST[] = {
28  "Sony SIE HMD *08",
29  "HTC Corporation HTC-VIVE",
30  "HTC Corporation VIVE Pro",
31  "Oculus VR Inc. Rift", /* Matches DK1, DK2 and CV1 */
32  "Valve Corporation Index HMD",
33 };
34 
35 /*!
36  * Window type to use.
37  *
38  * @ingroup comp_main
39  */
41 {
48 };
49 
50 
51 /*!
52  * Settings for the compositor.
53  *
54  * @ingroup comp_main
55  */
57 {
58  int display;
59 
60  VkFormat color_format;
61  VkColorSpaceKHR color_space;
62  VkPresentModeKHR present_mode;
63 
64  //! Window type to use.
66 
67  //! Distortion type to use.
69 
70  uint32_t width;
71  uint32_t height;
72 
73  struct
74  {
75  //! Display wireframe instead of solid triangles.
76  bool wireframe;
77  } debug;
78 
79  //! Not used with direct mode.
80  bool fullscreen;
81 
82  //! Should we debug print a lot!
83  bool print_spew;
84 
85  //! Should we debug print.
87 
88  //! Print information about available modes for direct mode.
90 
91  //! Should we flip y axis for compositor buffers (for GL)
92  bool flip_y;
93 
94  //! Nominal frame interval
96 
97  //! Enable vulkan validation for compositor
99 
100  //! Run the compositor on this Vulkan physical device
102 
103  //! Try to choose the mode with this index for direct mode
105 };
106 
107 /*!
108  * Initialize the settings struct with either defaults or loaded setting.
109  *
110  * @ingroup comp_main
111  */
112 void
113 comp_settings_init(struct comp_settings *s, struct xrt_device *xdev);
114 
115 
116 #ifdef __cplusplus
117 }
118 #endif
VkColorSpaceKHR color_space
Definition: comp_settings.h:61
Include all of the Vulkan headers in one place.
VkPresentModeKHR present_mode
Definition: comp_settings.h:62
Settings for the compositor.
Definition: comp_settings.h:56
Definition: comp_settings.h:42
#define XRT_MAYBE_UNUSED
Definition: xrt_compiler.h:50
xrt_distortion_model
Which distortion model does the device expose, used both as a bitfield and value. ...
Definition: xrt_defines.h:48
Definition: comp_settings.h:43
Definition: comp_settings.h:45
bool validate_vulkan
Enable vulkan validation for compositor.
Definition: comp_settings.h:98
Header defining a xrt HMD device.
bool fullscreen
Not used with direct mode.
Definition: comp_settings.h:80
VkFormat color_format
Definition: comp_settings.h:60
int gpu_index
Run the compositor on this Vulkan physical device.
Definition: comp_settings.h:101
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:28
bool print_debug
Should we debug print.
Definition: comp_settings.h:86
Header defining a XRT graphics provider.
uint32_t height
Definition: comp_settings.h:71
bool flip_y
Should we flip y axis for compositor buffers (for GL)
Definition: comp_settings.h:92
bool print_modes
Print information about available modes for direct mode.
Definition: comp_settings.h:89
Definition: comp_settings.h:46
uint32_t width
Definition: comp_settings.h:70
Definition: comp_settings.h:44
struct comp_settings::@26 debug
enum window_type window_type
Window type to use.
Definition: comp_settings.h:65
int desired_mode
Try to choose the mode with this index for direct mode.
Definition: comp_settings.h:104
uint64_t nominal_frame_interval_ns
Nominal frame interval.
Definition: comp_settings.h:95
window_type
Window type to use.
Definition: comp_settings.h:40
A single HMD or input device.
Definition: xrt_device.h:202
Definition: comp_settings.h:47
int display
Definition: comp_settings.h:58
bool wireframe
Display wireframe instead of solid triangles.
Definition: comp_settings.h:76
enum xrt_distortion_model distortion_model
Distortion type to use.
Definition: comp_settings.h:68
bool print_spew
Should we debug print a lot!
Definition: comp_settings.h:83