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 };
31 
32 /*!
33  * Window type to use.
34  *
35  * @ingroup comp_main
36  */
38 {
39  WINDOW_NONE = 0,
40  WINDOW_AUTO,
41  WINDOW_XCB,
42  WINDOW_WAYLAND,
43  WINDOW_DIRECT_RANDR,
44  WINDOW_DIRECT_NVIDIA,
45 };
46 
47 
48 /*!
49  * Settings for the compositor.
50  *
51  * @ingroup comp_main
52  */
54 {
55  int display;
56 
57  VkFormat color_format;
58  VkColorSpaceKHR color_space;
59  VkPresentModeKHR present_mode;
60 
61  //! Window type to use.
63 
64  //! Distortion type to use.
66 
67  uint32_t width;
68  uint32_t height;
69 
70  struct
71  {
72  //! Display wireframe instead of solid triangles.
73  bool wireframe;
74  } debug;
75 
76  //! Not used with direct mode.
77  bool fullscreen;
78 
79  //! Should we debug print a lot!
80  bool print_spew;
81 
82  //! Should we debug print.
84 
85  //! Print information about available modes for direct mode.
87 
88  //! Should we flip y axis for compositor buffers (for GL)
89  bool flip_y;
90 
91  //! Nominal frame interval
93 
94  //! Enable vulkan validation for compositor
96 
97  //! Run the compositor on this Vulkan physical device
98  int gpu_index;
99 
100  //! Try to choose the mode with this index for direct mode
102 };
103 
104 /*!
105  * Initialize the settings struct with either defaults or loaded setting.
106  *
107  * @ingroup comp_main
108  */
109 void
110 comp_settings_init(struct comp_settings *s, struct xrt_device *xdev);
111 
112 
113 #ifdef __cplusplus
114 }
115 #endif
Include all of the Vulkan headers in one place.
Settings for the compositor.
Definition: comp_settings.h:53
xrt_distortion_model
Which distortion model does the device expose, used both as a bitfield and value. ...
Definition: xrt_defines.h:47
bool validate_vulkan
Enable vulkan validation for compositor.
Definition: comp_settings.h:95
Header defining a xrt HMD device.
bool fullscreen
Not used with direct mode.
Definition: comp_settings.h:77
int gpu_index
Run the compositor on this Vulkan physical device.
Definition: comp_settings.h:98
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:83
Header defining a XRT graphics provider.
bool flip_y
Should we flip y axis for compositor buffers (for GL)
Definition: comp_settings.h:89
bool print_modes
Print information about available modes for direct mode.
Definition: comp_settings.h:86
enum window_type window_type
Window type to use.
Definition: comp_settings.h:62
int desired_mode
Try to choose the mode with this index for direct mode.
Definition: comp_settings.h:101
uint64_t nominal_frame_interval_ns
Nominal frame interval.
Definition: comp_settings.h:92
window_type
Window type to use.
Definition: comp_settings.h:37
A single HMD or input device.
Definition: xrt_device.h:203
bool wireframe
Display wireframe instead of solid triangles.
Definition: comp_settings.h:73
enum xrt_distortion_model distortion_model
Distortion type to use.
Definition: comp_settings.h:65
bool print_spew
Should we debug print a lot!
Definition: comp_settings.h:80