tangled
alpha
login
or
join now
matrixfurry.com
/
monado
0
fork
atom
The open source OpenXR runtime
0
fork
atom
overview
issues
pulls
pipelines
comp: Refactor documentation
Jakob Bornecrantz
6 years ago
8c06787d
b308facf
+74
-67
21 changed files
expand all
collapse all
unified
split
src
xrt
compositor
client
comp_egl_glue.c
comp_gl_glue.c
comp_gl_xlib_glue.c
comp_gles_glue.c
comp_vk_glue.c
main
comp_compositor.c
comp_compositor.h
comp_distortion.c
comp_distortion.h
comp_documentation.h
comp_renderer.c
comp_renderer.h
comp_settings.c
comp_settings.h
comp_swapchain.c
comp_vk_swapchain.c
comp_vk_swapchain.h
comp_window.h
comp_window_direct_mode.cpp
comp_window_wayland.c
comp_window_xcb.cpp
+1
-1
src/xrt/compositor/client/comp_egl_glue.c
···
5
5
* @brief Glue code to EGL client side glue code.
6
6
* @author Drew DeVault <sir@cmpwn.com>
7
7
* @author Simon Ser <contact@emersion.fr>
8
8
-
* @ingroup comp
8
8
+
* @ingroup comp_client
9
9
*/
10
10
11
11
#define EGL_EGL_PROTOTYPES 0
+2
-2
src/xrt/compositor/client/comp_gl_glue.c
···
2
2
// SPDX-License-Identifier: BSL-1.0
3
3
/*!
4
4
* @file
5
5
-
* @brief Glue code to OpenGL client side glue code.
5
5
+
* @brief Glue code to OpenGL client side code.
6
6
* @author Jakob Bornecrantz <jakob@collabora.com>
7
7
-
* @ingroup comp
7
7
+
* @ingroup comp_client
8
8
*/
9
9
10
10
#include "xrt/xrt_gfx_gl.h"
+2
-2
src/xrt/compositor/client/comp_gl_xlib_glue.c
···
2
2
// SPDX-License-Identifier: BSL-1.0
3
3
/*!
4
4
* @file
5
5
-
* @brief Glue code to OpenGL Xlib client side glue code.
5
5
+
* @brief Glue code to OpenGL Xlib client side code.
6
6
* @author Jakob Bornecrantz <jakob@collabora.com>
7
7
-
* @ingroup comp
7
7
+
* @ingroup comp_client
8
8
*/
9
9
10
10
#include <stdio.h>
+2
-2
src/xrt/compositor/client/comp_gles_glue.c
···
2
2
// SPDX-License-Identifier: BSL-1.0
3
3
/*!
4
4
* @file
5
5
-
* @brief Glue code to OpenGL ES client side glue code.
5
5
+
* @brief Glue code to OpenGL ES client side code.
6
6
* @author Simon Ser <contact@emersion.fr>
7
7
-
* @ingroup comp
7
7
+
* @ingroup comp_client
8
8
*/
9
9
10
10
#include "xrt/xrt_gfx_gles.h"
+2
-2
src/xrt/compositor/client/comp_vk_glue.c
···
2
2
// SPDX-License-Identifier: BSL-1.0
3
3
/*!
4
4
* @file
5
5
-
* @brief Glue code to vulkan client side glue code.
5
5
+
* @brief Glue code to vulkan client side code.
6
6
* @author Jakob Bornecrantz <jakob@collabora.com>
7
7
-
* @ingroup comp
7
7
+
* @ingroup comp_client
8
8
*/
9
9
10
10
#include <stdlib.h>
+1
-1
src/xrt/compositor/main/comp_compositor.c
···
6
6
* @author Jakob Bornecrantz <jakob@collabora.com>
7
7
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
8
8
* @author Ryan Pavlik <ryan.pavlik@collabora.com>
9
9
-
* @ingroup comp
9
9
+
* @ingroup comp_main
10
10
*
11
11
*
12
12
* begin_frame and end_frame delimit the application's work on graphics for a
+13
-13
src/xrt/compositor/main/comp_compositor.h
···
5
5
* @brief Main compositor written using Vulkan header.
6
6
* @author Jakob Bornecrantz <jakob@collabora.com>
7
7
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
8
8
-
* @ingroup comp
8
8
+
* @ingroup comp_main
9
9
*/
10
10
11
11
#pragma once
···
30
30
/*!
31
31
* A single swapchain image, holds the needed state for tracking image usage.
32
32
*
33
33
-
* @ingroup comp
33
33
+
* @ingroup comp_main
34
34
*/
35
35
struct comp_swapchain_image
36
36
{
···
50
50
*
51
51
* Not used by the window backend that uses the vk_swapchain to render to.
52
52
*
53
53
-
* @ingroup comp
53
53
+
* @ingroup comp_main
54
54
*/
55
55
struct comp_swapchain
56
56
{
···
64
64
/*!
65
65
* Main compositor struct tying everything in the compositor together.
66
66
*
67
67
-
* @ingroup comp
67
67
+
* @ingroup comp_main
68
68
*/
69
69
struct comp_compositor
70
70
{
···
139
139
/*!
140
140
* Convinence function to convert a xrt_swapchain to a comp_swapchain.
141
141
*
142
142
-
* @ingroup comp
142
142
+
* @ingroup comp_main
143
143
*/
144
144
XRT_MAYBE_UNUSED static struct comp_swapchain *
145
145
comp_swapchain(struct xrt_swapchain *xsc)
···
150
150
/*!
151
151
* Convinence function to convert a xrt_compositor to a comp_compositor.
152
152
*
153
153
-
* @ingroup comp
153
153
+
* @ingroup comp_main
154
154
*/
155
155
XRT_MAYBE_UNUSED static struct comp_compositor *
156
156
comp_compositor(struct xrt_compositor *xc)
···
161
161
/*!
162
162
* A compositor function that is implemented in the swapchain code.
163
163
*
164
164
-
* @ingroup comp
164
164
+
* @ingroup comp_main
165
165
*/
166
166
struct xrt_swapchain *
167
167
comp_swapchain_create(struct xrt_compositor *xc,
···
179
179
* Free and destroy any initialized fields on the given image, safe to pass in
180
180
* images that has one or all fields set to NULL.
181
181
*
182
182
-
* @ingroup comp
182
182
+
* @ingroup comp_main
183
183
*/
184
184
void
185
185
comp_swapchain_image_cleanup(struct vk_bundle *vk,
···
189
189
/*!
190
190
* Printer helper.
191
191
*
192
192
-
* @ingroup comp
192
192
+
* @ingroup comp_main
193
193
*/
194
194
void
195
195
comp_compositor_print(struct comp_compositor *c,
···
200
200
/*!
201
201
* Spew level logging.
202
202
*
203
203
-
* @ingroup comp
203
203
+
* @ingroup comp_main
204
204
*/
205
205
#define COMP_SPEW(c, ...) \
206
206
do { \
···
212
212
/*!
213
213
* Debug level logging.
214
214
*
215
215
-
* @ingroup comp
215
215
+
* @ingroup comp_main
216
216
*/
217
217
#define COMP_DEBUG(c, ...) \
218
218
do { \
···
224
224
/*!
225
225
* Mode printing.
226
226
*
227
227
-
* @ingroup comp
227
227
+
* @ingroup comp_main
228
228
*/
229
229
#define COMP_PRINT_MODE(c, ...) \
230
230
do { \
···
236
236
/*!
237
237
* Error level logging.
238
238
*
239
239
-
* @ingroup comp
239
239
+
* @ingroup comp_main
240
240
*/
241
241
#define COMP_ERROR(c, ...) \
242
242
do { \
+1
-1
src/xrt/compositor/main/comp_distortion.c
···
5
5
* @brief Distortion shader code.
6
6
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7
7
* @author Jakob Bornecrantz <jakob@collabora.com>
8
8
-
* @ingroup comp
8
8
+
* @ingroup comp_main
9
9
*/
10
10
11
11
#include <stdio.h>
+7
-7
src/xrt/compositor/main/comp_distortion.h
···
5
5
* @brief Distortion shader code header.
6
6
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7
7
* @author Jakob Bornecrantz <jakob@collabora.com>
8
8
-
* @ingroup comp
8
8
+
* @ingroup comp_main
9
9
*/
10
10
11
11
#pragma once
···
29
29
/*!
30
30
* Helper buffer for a single uniform buffer.
31
31
*
32
32
-
* @ingroup comp
32
32
+
* @ingroup comp_main
33
33
*/
34
34
struct comp_uniform_buffer
35
35
{
···
47
47
/*!
48
48
* Helper struct that encapsulate a distortion rendering code.
49
49
*
50
50
-
* @ingroup comp
50
50
+
* @ingroup comp_main
51
51
*/
52
52
struct comp_distortion
53
53
{
···
116
116
/*!
117
117
* Init a distortion, pass in the distortion so it can be embedded in a struct.
118
118
*
119
119
-
* @ingroup comp
119
119
+
* @ingroup comp_main
120
120
*/
121
121
void
122
122
comp_distortion_init(struct comp_distortion *d,
···
131
131
/*!
132
132
* Free and destroy all fields, does not free the destortion itself.
133
133
*
134
134
-
* @ingroup comp
134
134
+
* @ingroup comp_main
135
135
*/
136
136
void
137
137
comp_distortion_destroy(struct comp_distortion *d);
···
139
139
/*!
140
140
* Update the descriptor set to a new image.
141
141
*
142
142
-
* @ingroup comp
142
142
+
* @ingroup comp_main
143
143
*/
144
144
void
145
145
comp_distortion_update_descriptor_set(struct comp_distortion *d,
···
150
150
/*!
151
151
* Submit draw commands to the given command_buffer.
152
152
*
153
153
-
* @ingroup comp
153
153
+
* @ingroup comp_main
154
154
*/
155
155
void
156
156
comp_distortion_draw_quad(struct comp_distortion *d,
+13
-6
src/xrt/compositor/main/comp_documentation.h
···
2
2
// SPDX-License-Identifier: BSL-1.0
3
3
/*!
4
4
* @file
5
5
-
* @brief Main compositor written using Vulkan header.
5
5
+
* @brief Documentation for the compositor.
6
6
* @author Jakob Bornecrantz <jakob@collabora.com>
7
7
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
8
8
* @ingroup comp
···
15
15
* @defgroup comp Compositor
16
16
* @ingroup xrt
17
17
*
18
18
-
* @brief Main compositing code.
18
18
+
* @brief All of the compositor code.
19
19
+
*/
20
20
+
21
21
+
/*!
22
22
+
* @defgroup comp_main Main compositor code
23
23
+
* @ingroup comp
24
24
+
*
25
25
+
* @brief Main compositor code.
19
26
*/
20
27
21
28
/*!
22
22
-
* @defgroup comp_client Compositor client glue code
29
29
+
* @defgroup comp_client Compositor client code
23
30
* @ingroup comp
24
31
*
25
32
* @brief Glue code between client program to the main compositor.
···
29
36
* @dir compositor
30
37
* @ingroup xrt
31
38
*
32
32
-
* @brief The compositor for Monado.
39
39
+
* @brief All of the compositor code.
33
40
*/
34
41
35
42
/*!
36
43
* @dir compositor/client
37
44
* @ingroup comp
38
45
*
39
39
-
* @brief Smaller pieces of auxiliary utilities code.
46
46
+
* @brief Compositor client code.
40
47
*/
41
48
42
49
/*!
43
50
* @dir compositor/main
44
51
* @ingroup comp
45
52
*
46
46
-
* @brief Main chunk of compositor code.
53
53
+
* @brief Main compositor code.
47
54
*/
+2
-2
src/xrt/compositor/main/comp_renderer.c
···
5
5
* @brief Compositor rendering code.
6
6
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7
7
* @author Jakob Bornecrantz <jakob@collabora.com>
8
8
-
* @ingroup comp
8
8
+
* @ingroup comp_main
9
9
*/
10
10
11
11
#include <string.h>
···
28
28
/*!
29
29
* Holds associated vulkan objects and state to render with a distortion.
30
30
*
31
31
-
* @ingroup comp
31
31
+
* @ingroup comp_main
32
32
*/
33
33
struct comp_renderer
34
34
{
+4
-4
src/xrt/compositor/main/comp_renderer.h
···
5
5
* @brief Compositor rendering code header.
6
6
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7
7
* @author Jakob Bornecrantz <jakob@collabora.com>
8
8
-
* @ingroup comp
8
8
+
* @ingroup comp_main
9
9
*/
10
10
11
11
#pragma once
···
24
24
/*!
25
25
* Called by the main compositor code to create the renderer.
26
26
*
27
27
-
* @ingroup comp
27
27
+
* @ingroup comp_main
28
28
*/
29
29
struct comp_renderer *
30
30
comp_renderer_create(struct comp_compositor *c);
···
32
32
/*!
33
33
* Render a distorted stereo frame.
34
34
*
35
35
-
* @ingroup comp
35
35
+
* @ingroup comp_main
36
36
*/
37
37
void
38
38
comp_renderer_frame(struct comp_renderer *r,
···
44
44
/*!
45
45
* Clean up and free the renderer.
46
46
*
47
47
-
* @ingroup comp
47
47
+
* @ingroup comp_main
48
48
*/
49
49
void
50
50
comp_renderer_destroy(struct comp_renderer *r);
+1
-1
src/xrt/compositor/main/comp_settings.c
···
4
4
* @file
5
5
* @brief Settings struct for compositor.
6
6
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7
7
-
* @ingroup comp
7
7
+
* @ingroup comp_main
8
8
*/
9
9
10
10
#include "util/u_debug.h"
+4
-4
src/xrt/compositor/main/comp_settings.h
···
5
5
* @brief Settings struct for compositor header.
6
6
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7
7
* @author Jakob Bornecrantz <jakob@collabora.com>
8
8
-
* @ingroup comp
8
8
+
* @ingroup comp_main
9
9
*/
10
10
11
11
#pragma once
···
32
32
/*!
33
33
* Window type to use.
34
34
*
35
35
-
* @ingroup comp
35
35
+
* @ingroup comp_main
36
36
*/
37
37
enum window_type
38
38
{
···
48
48
/*!
49
49
* Settings for the compositor.
50
50
*
51
51
-
* @ingroup comp
51
51
+
* @ingroup comp_main
52
52
*/
53
53
struct comp_settings
54
54
{
···
104
104
/*!
105
105
* Initialize the settings struct with either defaults or loaded setting.
106
106
*
107
107
-
* @ingroup comp
107
107
+
* @ingroup comp_main
108
108
*/
109
109
void
110
110
comp_settings_init(struct comp_settings *s, struct xrt_device *xdev);
+1
-1
src/xrt/compositor/main/comp_swapchain.c
···
4
4
* @file
5
5
* @brief Swapchain code for the main compositor.
6
6
* @author Jakob Bornecrantz <jakob@collabora.com>
7
7
-
* @ingroup comp
7
7
+
* @ingroup comp_main
8
8
*/
9
9
10
10
#include <stdio.h>
+1
-1
src/xrt/compositor/main/comp_vk_swapchain.c
···
5
5
* @brief Vulkan swapchain code.
6
6
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7
7
* @author Jakob Bornecrantz <jakob@collabora.com>
8
8
-
* @ingroup comp_client
8
8
+
* @ingroup comp_main
9
9
*/
10
10
11
11
+9
-9
src/xrt/compositor/main/comp_vk_swapchain.h
···
5
5
* @brief Vulkan swapchain code header.
6
6
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7
7
* @author Jakob Bornecrantz <jakob@collabora.com>
8
8
-
* @ingroup comp_client
8
8
+
* @ingroup comp_main
9
9
*/
10
10
11
11
#pragma once
···
26
26
/*!
27
27
* Callback when a @ref vk_swapchain changes size.
28
28
*
29
29
-
* @ingroup comp
29
29
+
* @ingroup comp_main
30
30
*/
31
31
typedef void (*vk_swapchain_cb)(uint32_t width, uint32_t height, void *priv);
32
32
33
33
/*!
34
34
* A pair of VkImage and VkImageView.
35
35
*
36
36
-
* @ingroup comp
36
36
+
* @ingroup comp_main
37
37
*/
38
38
struct vk_swapchain_buffer
39
39
{
···
44
44
/*!
45
45
* Wraps and manage VkSwapchainKHR and VkSurfaceKHR, used by @ref comp code.
46
46
*
47
47
-
* @ingroup comp
47
47
+
* @ingroup comp_main
48
48
*/
49
49
struct vk_swapchain
50
50
{
···
76
76
/*!
77
77
* Wraps and manage VkSwapchainKHR and VkSurfaceKHR, used by @ref comp code.
78
78
*
79
79
-
* @ingroup comp
79
79
+
* @ingroup comp_main
80
80
*/
81
81
void
82
82
vk_swapchain_init(struct vk_swapchain *sc,
···
87
87
/*!
88
88
* Initialize the given @ref vk_swapchain, does not allocate.
89
89
*
90
90
-
* @ingroup comp
90
90
+
* @ingroup comp_main
91
91
*/
92
92
void
93
93
vk_swapchain_create(struct vk_swapchain *sc,
···
100
100
/*!
101
101
* Acquire a image index from the given @ref vk_swapchain for rendering.
102
102
*
103
103
-
* @ingroup comp
103
103
+
* @ingroup comp_main
104
104
*/
105
105
VkResult
106
106
vk_swapchain_acquire_next_image(struct vk_swapchain *sc,
···
110
110
/*!
111
111
* Make the given @ref vk_swapchain present the next acquired image.
112
112
*
113
113
-
* @ingroup comp
113
113
+
* @ingroup comp_main
114
114
*/
115
115
VkResult
116
116
vk_swapchain_present(struct vk_swapchain *sc,
···
122
122
* Free all managed resources on the given @ref vk_swapchain,
123
123
* does not free the struct itself.
124
124
*
125
125
-
* @ingroup comp
125
125
+
* @ingroup comp_main
126
126
*/
127
127
void
128
128
vk_swapchain_cleanup(struct vk_swapchain *sc);
+5
-5
src/xrt/compositor/main/comp_window.h
···
5
5
* @brief Compositor window header.
6
6
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7
7
* @author Jakob Bornecrantz <jakob@collabora.com>
8
8
-
* @ingroup comp
8
8
+
* @ingroup comp_main
9
9
*/
10
10
11
11
#pragma once
···
27
27
/*!
28
28
* A output device or a window, often directly connected to the device.
29
29
*
30
30
-
* @ingroup comp
30
30
+
* @ingroup comp_main
31
31
*/
32
32
struct comp_window
33
33
{
···
60
60
/*!
61
61
* Create a xcb window.
62
62
*
63
63
-
* @ingroup comp
63
63
+
* @ingroup comp_main
64
64
*/
65
65
struct comp_window *
66
66
comp_window_xcb_create(struct comp_compositor *c);
···
70
70
/*!
71
71
* Create a wayland window.
72
72
*
73
73
-
* @ingroup comp
73
73
+
* @ingroup comp_main
74
74
*/
75
75
struct comp_window *
76
76
comp_window_wayland_create(struct comp_compositor *c);
···
80
80
/*!
81
81
* Create a direct surface to a HMD.
82
82
*
83
83
-
* @ingroup comp
83
83
+
* @ingroup comp_main
84
84
*/
85
85
struct comp_window *
86
86
comp_window_direct_create(struct comp_compositor *c);
+1
-1
src/xrt/compositor/main/comp_window_direct_mode.cpp
···
5
5
* @brief Direct mode window code.
6
6
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7
7
* @author Jakob Bornecrantz <jakob@collabora.com>
8
8
-
* @ingroup comp
8
8
+
* @ingroup comp_main
9
9
*/
10
10
11
11
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
+1
-1
src/xrt/compositor/main/comp_window_wayland.c
···
5
5
* @brief Wayland window code.
6
6
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7
7
* @author Jakob Bornecrantz <jakob@collabora.com>
8
8
-
* @ingroup comp
8
8
+
* @ingroup comp_main
9
9
*/
10
10
11
11
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
+1
-1
src/xrt/compositor/main/comp_window_xcb.cpp
···
5
5
* @brief XCB window code.
6
6
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7
7
* @author Jakob Bornecrantz <jakob@collabora.com>
8
8
-
* @ingroup comp
8
8
+
* @ingroup comp_main
9
9
*/
10
10
11
11
#ifdef VK_USE_PLATFORM_XCB_KHR