Monado OpenXR Runtime
comp_render.h
Go to the documentation of this file.
1// Copyright 2019-2024, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Compositor render implementation.
6 * @author Jakob Bornecrantz <jakob@collabora.com>
7 * @author Rylie Pavlik <rylie.pavlik@collabora.com>
8 * @ingroup comp_util
9 */
10
11#pragma once
12
13#include "xrt/xrt_defines.h"
14#include "xrt/xrt_vulkan_includes.h" // IWYU pragma: keep
15
17#include "util/u_misc.h"
18
19#include <assert.h>
20
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26struct comp_layer;
27struct render_compute;
28struct render_gfx;
30
31
32/*!
33 * @defgroup comp_render
34 * @brief Renders, aka "layer squashers" and distortion application.
35 *
36 * Two parallel implementations of the render module exist:
37 *
38 * - one uses graphics shaders (aka GFX, @ref comp_render_gfx, @ref comp_render_gfx.c)
39 * - the other uses compute shaders (aka CS, @ref comp_render_cs, @ref comp_render_cs.c)
40 *
41 * Their abilities are effectively equivalent, although the graphics version disregards depth
42 * data, while the compute shader does use it somewhat.
43 *
44 * @note In general this module requires that swapchains in your supplied @ref comp_layer layers
45 * implement @ref comp_swapchain in addition to just @ref xrt_swapchain.
46 */
47
48/*
49 *
50 * Input data struct.
51 *
52 */
53
54/*!
55 * @name Input data structs
56 * @{
57 */
58
59/*!
60 * The input data needed for a single view, shared between both GFX and CS
61 * paths.
62 *
63 * To fully render a single view two "rendering" might be needed, the
64 * first being the layer squashing, and the second is the distortion step. The
65 * target for the layer squashing is referred to as "layer" or "scratch" and
66 * prefixed with `layer` if needs be. The other final step is referred to as
67 * "distortion target" or just "target", and is prefixed with `target`.
68 *
69 * @ingroup comp_render
70 */
72{
73 //! New world pose of this view.
75
76 //! New eye pose of this view.
78
79 /*!
80 * New fov of this view, used for the layer scratch image. Needs to
81 * match distortion parameters if distortion is used.
82 */
83 struct xrt_fov fov;
84
85 /*!
86 * The layer image for this view (aka scratch image),
87 * used for barrier operations.
88 */
89 VkImage image;
90
91 /*!
92 * View into layer image (aka scratch image),
93 * used for both GFX (read/write) and CS (read) paths.
94 */
95 VkImageView srgb_view;
96
97 /*!
98 * Pre-view layer target viewport_data (where in the image we should
99 * render the view).
100 */
102
103 /*!
104 * When sampling from the layer image (aka scratch image), how should we
105 * transform it to get to the pixels correctly.
106 */
108
109 //! Go from UV to tanangle for the target, this needs to match @p fov.
111
112 // Distortion target viewport data (aka target).
113 struct render_viewport_data target_viewport_data;
114
115 struct
116 {
117 //! Per-view layer target resources.
119
120 //! Distortion target vertex rotation information.
122 } gfx;
123
124 struct
125 {
126 //! Only used on compute path.
127 VkImageView unorm_view;
128 } cs;
129};
130
131/*!
132 * The input data needed for a complete layer squashing distortion rendering
133 * to a target. This struct is shared between GFX and CS paths.
134 *
135 * @ingroup comp_render
136 */
138{
139 struct comp_render_view_data views[XRT_MAX_VIEWS];
140
141 //! The number of views currently in this dispatch data.
142 uint32_t view_count;
143
144 //! Fast path can be disabled for mirroing so needs to be an argument.
146
147 //! Very often true, can be disabled for debugging.
149
150 //! Members used only by GFX @ref comp_render_gfx
151 struct
152 {
153 //! The resources needed for the target.
156
157 //! Members used only by CS @ref comp_render_cs
158 struct
159 {
160 //! Target image for distortion, used for barrier.
162
163 //! Target image view for distortion.
164 VkImageView target_unorm_view;
165 } cs;
166};
167
168/*!
169 * Shared implementation setting up common view params between GFX and CS.
170 *
171 * Private implementation method, do not use outside of more-specific add_view calls!
172 *
173 * @param data Common render dispatch data, will be updated
174 * @param world_pose New world pose of this view.
175 * Populates @ref comp_render_view_data::world_pose
176 * @param eye_pose New eye pose of this view
177 * Populates @ref comp_render_view_data::eye_pose
178 * @param fov Assigned to fov in the view data, and used to compute @ref comp_render_view_data::target_pre_transform
179 * Populates @ref comp_render_view_data::fov
180 * @param layer_viewport_data Where in the image to render the view
181 * Populates @ref comp_render_view_data::layer_viewport_data
182 * @param layer_norm_rect How to transform when sampling from the scratch image.
183 * Populates @ref comp_render_view_data::layer_norm_rect
184 * @param image Scratch image for this view
185 * Populates @ref comp_render_view_data::image
186 * @param srgb_view SRGB image view into the scratch image
187 * Populates @ref comp_render_view_data::srgb_view
188 * @param target_viewport_data Distortion target viewport data (aka target)
189 * Populates @ref comp_render_view_data::target_viewport_data
190
191 * @return Pointer to the @ref comp_render_view_data we have been populating, for additional setup.
192 */
193static inline struct comp_render_view_data *
195 const struct xrt_pose *world_pose,
196 const struct xrt_pose *eye_pose,
197 const struct xrt_fov *fov,
200 VkImage image,
201 VkImageView srgb_view,
202 const struct render_viewport_data *target_viewport_data)
203{
204 uint32_t i = data->view_count++;
205
206 assert(i < ARRAY_SIZE(data->views));
207
208 struct comp_render_view_data *view = &data->views[i];
209
211
212 view->world_pose = *world_pose;
213 view->eye_pose = *eye_pose;
214 view->fov = *fov;
215 view->image = image;
216 view->srgb_view = srgb_view;
219 view->target_viewport_data = *target_viewport_data;
220
221 return view;
222}
223
224/*! @} */
225
226/*
227 *
228 * Gfx functions.
229 *
230 */
231
232/*!
233 *
234 * @defgroup comp_render_gfx
235 *
236 * GFX renderer control and dispatch - uses graphics shaders.
237 *
238 * Depends on the common @ref comp_render_dispatch_data, as well as the resources
239 * @ref render_gfx_target_resources (often called `rtr`), and @ref render_gfx.
240 *
241 * @ingroup comp_render
242 * @{
243 */
244
245/*!
246 * Initialize structure for use of the GFX renderer.
247 *
248 * @param[out] data Common render dispatch data. Will be zeroed and initialized.
249 * @param rtr GFX-specific resources for the entire frameedg. Must be populated before call.
250 * @param fast_path Whether we will use the "fast path" avoiding layer squashing.
251 * @param do_timewarp Whether timewarp (reprojection) will be performed.
252 */
253static inline void
256 bool fast_path,
257 bool do_timewarp)
258{
259 U_ZERO(data);
260
261 data->fast_path = fast_path;
262 data->do_timewarp = do_timewarp;
263 data->gfx.rtr = rtr;
264}
265
266/*!
267 * Add view to the common data, as required by the GFX renderer.
268 *
269 * @param[in,out] data Common render dispatch data, will be updated
270 * @param world_pose New world pose of this view.
271 * Populates @ref comp_render_view_data::world_pose
272 * @param eye_pose New eye pose of this view
273 * Populates @ref comp_render_view_data::eye_pose
274 * @param fov Assigned to fov in the view data, and used to
275 * compute @ref comp_render_view_data::target_pre_transform - also
276 * populates @ref comp_render_view_data::fov
277 * @param rtr Will be associated with this view. GFX-specific
278 * @param layer_viewport_data Where in the image to render the view
279 * Populates @ref comp_render_view_data::layer_viewport_data
280 * @param layer_norm_rect How to transform when sampling from the scratch image.
281 * Populates @ref comp_render_view_data::layer_norm_rect
282 * @param image Scratch image for this view
283 * Populates @ref comp_render_view_data::image
284 * @param srgb_view SRGB image view into the scratch image
285 * Populates @ref comp_render_view_data::srgb_view
286 * @param vertex_rot
287 * @param target_viewport_data Distortion target viewport data (aka target)
288 * Populates @ref comp_render_view_data::target_viewport_data
289 */
290static inline void
292 const struct xrt_pose *world_pose,
293 const struct xrt_pose *eye_pose,
294 const struct xrt_fov *fov,
298 VkImage image,
299 VkImageView srgb_view,
300 const struct xrt_matrix_2x2 *vertex_rot,
301 const struct render_viewport_data *target_viewport_data)
302{
304 data, //
305 world_pose, //
306 eye_pose, //
307 fov, //
310 image, //
311 srgb_view, //
312 target_viewport_data);
313
314 // TODO why is the one in data not used instead
315 view->gfx.rtr = rtr;
316 view->gfx.vertex_rot = *vertex_rot;
317}
318
319/*!
320 * Dispatch the (graphics pipeline) layer squasher, on any number of views.
321 *
322 * All source layer images needs to be in the correct image layout, no barrier
323 * is inserted for them. The target images are barriered from undefined to general
324 * so they can be written to, then to the layout defined by @p transition_to.
325 *
326 * Expected layouts:
327 *
328 * - Layer images: `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL`
329 * - Target images: Any
330 *
331 * After call layouts:
332 *
333 * - Layer images: `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL`
334 * - Target images: @p transition_to
335 *
336 * @note Swapchains in the @p layers must implement @ref comp_swapchain in
337 * addition to just @ref xrt_swapchain, as this function downcasts to @ref comp_swapchain !
338 *
339 * @param render Graphics renderer object
340 * @param[in] layers Layers to render, see note.
341 * @param[in] layer_count Number of elements in @p layers array.
342 * @param[in] d Common render dispatch data
343 * @param[in] transition_to Desired image layout for target images
344 */
345void
347 const struct comp_layer *layers,
348 uint32_t layer_count,
349 const struct comp_render_dispatch_data *d,
350 VkImageLayout transition_to);
351
352/*!
353 * Writes the needed commands to the @ref render_gfx to do a full composition with distortion.
354 *
355 * Takes a set of layers, new device poses, scratch
356 * images with associated @ref render_gfx_target_resources and writes the needed
357 * commands to the @ref render_gfx to do a full composition with distortion.
358 * The scratch images are optionally used to squash layers should it not be
359 * possible to do a @p comp_render_dispatch_data::fast_path. Will use the render
360 * passes of the targets which set the layout.
361 *
362 * The render passes of @p comp_render_dispatch_data::views::rtr must be created
363 * with a final_layout of `VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL` or there will
364 * be validation errors.
365 *
366 * Expected layouts:
367 *
368 * - Layer images: `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL`
369 * - Scratch images: Any (as per the @ref render_gfx_render_pass)
370 * - Target image: Any (as per the @ref render_gfx_render_pass)
371 *
372 * After call layouts:
373 *
374 * - Layer images: `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL`
375 * - Scratch images: `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL`
376 * - Target image: What the render pass of @p rtr specifies.
377 *
378 * @note Swapchains in the @p layers must implement @ref comp_swapchain in
379 * addition to just @ref xrt_swapchain, as this function downcasts to @ref comp_swapchain !
380 *
381 * @param render GFX render object
382 * @param[in] layers Layers to render, see note.
383 * @param[in] layer_count Number of elements in @p layers array.
384 * @param[in] d Common render dispatch data
385 */
386void
388 const struct comp_layer *layers,
389 const uint32_t layer_count,
390 const struct comp_render_dispatch_data *d);
391
392/* end of comp_render_gfx group */
393
394/*! @} */
395
396
397/*
398 *
399 * CS functions.
400 *
401 */
402
403/*!
404 *
405 * @defgroup comp_render_cs
406 *
407 * CS renderer control and dispatch - uses compute shaders
408 *
409 * Depends on @ref render_compute
410 *
411 * @ingroup comp_render
412 * @{
413 */
414
415/*!
416 * Initialize structure for use of the CS renderer.
417 *
418 * @param data Common render dispatch data. Will be zeroed and initialized.
419 * @param target_image Image to render into
420 * @param target_unorm_view Corresponding image view
421 * @param fast_path Whether we will use the "fast path" avoiding layer squashing.
422 * @param do_timewarp Whether timewarp (reprojection) will be performed.
423 */
424static inline void
426 VkImage target_image,
427 VkImageView target_unorm_view,
428 bool fast_path,
429 bool do_timewarp)
430{
431 U_ZERO(data);
432
433 data->fast_path = fast_path;
434 data->do_timewarp = do_timewarp;
435
436 data->cs.target_image = target_image;
437 data->cs.target_unorm_view = target_unorm_view;
438}
439
440/*!
441 * Add view to the common data, as required by the CS renderer.
442 *
443 * @param[in,out] data Common render dispatch data, will be updated
444 * @param world_pose New world pose of this view.
445 * Populates @ref comp_render_view_data::world_pose
446 * @param eye_pose New eye pose of this view
447 * Populates @ref comp_render_view_data::eye_pose
448 * @param fov Assigned to fov in the view data, and used to compute @ref comp_render_view_data::target_pre_transform
449 * Populates @ref comp_render_view_data::fov
450 * @param layer_viewport_data Where in the image to render the view
451 * Populates @ref comp_render_view_data::layer_viewport_data
452 * @param layer_norm_rect How to transform when sampling from the scratch image.
453 * Populates @ref comp_render_view_data::layer_norm_rect
454 * @param image Scratch image for this view
455 * Populates @ref comp_render_view_data::image
456 * @param srgb_view SRGB image view into the scratch image
457 * Populates @ref comp_render_view_data::srgb_view
458 * @param unorm_view UNORM image view into the scratch image, CS specific
459 * @param target_viewport_data Distortion target viewport data (aka target)
460 * Populates @ref comp_render_view_data::target_viewport_data
461 */
462static inline void
464 const struct xrt_pose *world_pose,
465 const struct xrt_pose *eye_pose,
466 const struct xrt_fov *fov,
469 VkImage image,
470 VkImageView srgb_view,
471 VkImageView unorm_view,
472 const struct render_viewport_data *target_viewport_data)
473{
475 data, //
476 world_pose, //
477 eye_pose, //
478 fov, //
481 image, //
482 srgb_view, //
483 target_viewport_data);
484
485 view->cs.unorm_view = unorm_view;
486}
487
488/*!
489 * Dispatch the layer squasher for a single view.
490 *
491 * All source layer images and target image needs to be in the correct image
492 * layout, no barrier is inserted at all. The @p view_index argument is needed
493 * to grab a pre-allocated UBO from the @ref render_resources and to correctly
494 * select left/right data from various layers.
495 *
496 * Expected layouts:
497 *
498 * - Layer images: `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL`
499 * - Target images: `VK_IMAGE_LAYOUT_GENERAL`
500 *
501 * @note Swapchains in the @p layers must implement @ref comp_swapchain in
502 * addition to just @ref xrt_swapchain, as this function downcasts to @ref comp_swapchain !
503 *
504 * @param render Compute renderer object
505 * @param view_index Index of the view
506 * @param layers Layers to render, see note.
507 * @param layer_count Number of elements in @p layers array.
508 * @param pre_transform
509 * @param world_pose
510 * @param eye_pose
511 * @param target_image
512 * @param target_image_view
513 * @param target_view
514 * @param do_timewarp
515 */
516void
518 uint32_t view_index,
519 const struct comp_layer *layers,
520 const uint32_t layer_count,
521 const struct xrt_normalized_rect *pre_transform,
522 const struct xrt_pose *world_pose,
523 const struct xrt_pose *eye_pose,
524 const VkImage target_image,
525 const VkImageView target_image_view,
526 const struct render_viewport_data *target_view,
527 bool do_timewarp);
528
529/*!
530 * Dispatch the layer squasher, on any number of views.
531 *
532 * All source layer images needs to be in the correct image layout, no barrier
533 * is inserted for them. The target images are barriered from undefined to general
534 * so they can be written to, then to the layout defined by @p transition_to.
535 *
536 * Expected layouts:
537 *
538 * - Layer images: `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL`
539 * - Target images: Any
540 *
541 * After call layouts:
542 *
543 * - Layer images: `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL`
544 * - Target images: @p transition_to
545 *
546 * @note Swapchains in the @p layers must implement @ref comp_swapchain in
547 * addition to just @ref xrt_swapchain, as this function downcasts to @ref comp_swapchain !
548 *
549 * @param render Compute renderer object
550 * @param[in] layers Layers to render, see note.
551 * @param[in] layer_count Number of elements in @p layers array.
552 * @param[in] d Common render dispatch data
553 * @param[in] transition_to Desired image layout for target images
554 */
555void
557 const struct comp_layer *layers,
558 const uint32_t layer_count,
559 const struct comp_render_dispatch_data *d,
560 VkImageLayout transition_to);
561
562/*!
563 * Write commands to @p render to do a full composition with distortion.
564 *
565 * Helper function that takes a set of layers, new device poses, a scratch
566 * images and writes the needed commands to the @ref render_compute to do a full
567 * composition with distortion. The scratch images are optionally used to squash
568 * layers should it not be possible to do a fast_path. Will insert barriers to
569 * change the scratch images and target images to the needed layout.
570 *
571 *
572 * Expected layouts:
573 *
574 * - Layer images: `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL`
575 * - Scratch images: Any
576 * - Target image: Any
577 *
578 * After call layouts:
579 *
580 * - Layer images: `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL`
581 * - Scratch images: `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL`
582 * - Target image: `VK_IMAGE_LAYOUT_PRESENT_SRC_KHR`
583 *
584 * @note Swapchains in the @p layers must implement @ref comp_swapchain in
585 * addition to just @ref xrt_swapchain, as this function downcasts to @ref comp_swapchain !
586 *
587 * @param render Compute renderer object
588 * @param[in] layers Layers to render, see note.
589 * @param[in] layer_count Number of elements in @p layers array.
590 * @param[in] d Common render dispatch data
591 *
592 */
593void
595 const struct comp_layer *layers,
596 const uint32_t layer_count,
597 const struct comp_render_dispatch_data *d);
598
599/* end of comp_render_cs group */
600/*! @} */
601
602#ifdef __cplusplus
603}
604#endif
static struct comp_render_view_data * comp_render_dispatch_add_view(struct comp_render_dispatch_data *data, const struct xrt_pose *world_pose, const struct xrt_pose *eye_pose, const struct xrt_fov *fov, const struct render_viewport_data *layer_viewport_data, const struct xrt_normalized_rect *layer_norm_rect, VkImage image, VkImageView srgb_view, const struct render_viewport_data *target_viewport_data)
Shared implementation setting up common view params between GFX and CS.
Definition: comp_render.h:194
#define U_ZERO(PTR)
Zeroes the correct amount of memory based on the type pointed-to by the argument.
Definition: u_misc.h:68
void comp_render_cs_layers(struct render_compute *render, const struct comp_layer *layers, const uint32_t layer_count, const struct comp_render_dispatch_data *d, VkImageLayout transition_to)
Dispatch the layer squasher, on any number of views.
Definition: comp_render_cs.c:669
static void comp_render_cs_add_view(struct comp_render_dispatch_data *data, const struct xrt_pose *world_pose, const struct xrt_pose *eye_pose, const struct xrt_fov *fov, const struct render_viewport_data *layer_viewport_data, const struct xrt_normalized_rect *layer_norm_rect, VkImage image, VkImageView srgb_view, VkImageView unorm_view, const struct render_viewport_data *target_viewport_data)
Add view to the common data, as required by the CS renderer.
Definition: comp_render.h:463
void comp_render_cs_dispatch(struct render_compute *render, const struct comp_layer *layers, const uint32_t layer_count, const struct comp_render_dispatch_data *d)
Write commands to render to do a full composition with distortion.
Definition: comp_render_cs.c:716
static void comp_render_cs_initial_init(struct comp_render_dispatch_data *data, VkImage target_image, VkImageView target_unorm_view, bool fast_path, bool do_timewarp)
Initialize structure for use of the CS renderer.
Definition: comp_render.h:425
void comp_render_cs_layer(struct render_compute *render, uint32_t view_index, const struct comp_layer *layers, const uint32_t layer_count, const struct xrt_normalized_rect *pre_transform, const struct xrt_pose *world_pose, const struct xrt_pose *eye_pose, const VkImage target_image, const VkImageView target_image_view, const struct render_viewport_data *target_view, bool do_timewarp)
Dispatch the layer squasher for a single view.
Definition: comp_render_cs.c:498
static void comp_render_gfx_initial_init(struct comp_render_dispatch_data *data, struct render_gfx_target_resources *rtr, bool fast_path, bool do_timewarp)
Initialize structure for use of the GFX renderer.
Definition: comp_render.h:254
void comp_render_gfx_dispatch(struct render_gfx *render, const struct comp_layer *layers, const uint32_t layer_count, const struct comp_render_dispatch_data *d)
Writes the needed commands to the render_gfx to do a full composition with distortion.
Definition: comp_render_gfx.c:883
void comp_render_gfx_layers(struct render_gfx *render, const struct comp_layer *layers, uint32_t layer_count, const struct comp_render_dispatch_data *d, VkImageLayout transition_to)
Dispatch the (graphics pipeline) layer squasher, on any number of views.
Definition: comp_render_gfx.c:677
static void comp_render_gfx_add_view(struct comp_render_dispatch_data *data, const struct xrt_pose *world_pose, const struct xrt_pose *eye_pose, const struct xrt_fov *fov, struct render_gfx_target_resources *rtr, const struct render_viewport_data *layer_viewport_data, const struct xrt_normalized_rect *layer_norm_rect, VkImage image, VkImageView srgb_view, const struct xrt_matrix_2x2 *vertex_rot, const struct render_viewport_data *target_viewport_data)
Add view to the common data, as required by the GFX renderer.
Definition: comp_render.h:291
void render_calc_uv_to_tangent_lengths_rect(const struct xrt_fov *fov, struct xrt_normalized_rect *out_rect)
This function constructs a transformation in the form of a normalized rect that lets you go from a UV...
Definition: render_util.c:127
The NEW compositor rendering code header.
A single layer in a comp_layer_accum.
Definition: comp_layer_accum.h:36
The input data needed for a complete layer squashing distortion rendering to a target.
Definition: comp_render.h:138
uint32_t view_count
The number of views currently in this dispatch data.
Definition: comp_render.h:142
struct render_gfx_target_resources * rtr
The resources needed for the target.
Definition: comp_render.h:154
bool do_timewarp
Very often true, can be disabled for debugging.
Definition: comp_render.h:148
struct comp_render_dispatch_data::@111 cs
Members used only by CS Comp_render_cs.
VkImage target_image
Target image for distortion, used for barrier.
Definition: comp_render.h:161
VkImageView target_unorm_view
Target image view for distortion.
Definition: comp_render.h:164
bool fast_path
Fast path can be disabled for mirroing so needs to be an argument.
Definition: comp_render.h:145
struct comp_render_dispatch_data::@110 gfx
Members used only by GFX Comp_render_gfx.
The input data needed for a single view, shared between both GFX and CS paths.
Definition: comp_render.h:72
VkImageView unorm_view
Only used on compute path.
Definition: comp_render.h:127
VkImageView srgb_view
View into layer image (aka scratch image), used for both GFX (read/write) and CS (read) paths.
Definition: comp_render.h:95
struct xrt_fov fov
New fov of this view, used for the layer scratch image.
Definition: comp_render.h:83
struct render_viewport_data layer_viewport_data
Pre-view layer target viewport_data (where in the image we should render the view).
Definition: comp_render.h:101
struct xrt_matrix_2x2 vertex_rot
Distortion target vertex rotation information.
Definition: comp_render.h:121
struct xrt_pose world_pose
New world pose of this view.
Definition: comp_render.h:74
struct render_gfx_target_resources * rtr
Per-view layer target resources.
Definition: comp_render.h:118
struct xrt_pose eye_pose
New eye pose of this view.
Definition: comp_render.h:77
VkImage image
The layer image for this view (aka scratch image), used for barrier operations.
Definition: comp_render.h:89
struct xrt_normalized_rect layer_norm_rect
When sampling from the layer image (aka scratch image), how should we transform it to get to the pixe...
Definition: comp_render.h:107
struct xrt_normalized_rect target_pre_transform
Go from UV to tanangle for the target, this needs to match fov.
Definition: comp_render.h:110
The semi-low level resources and operations required to squash layers and/or apply distortion for a s...
Definition: render_interface.h:1166
Each rendering (render_gfx) render to one or more targets (render_gfx_target_resources),...
Definition: render_interface.h:785
The low-level resources and operations to perform layer squashing and/or mesh distortion for a single...
Definition: render_interface.h:848
The pure data information about a view that the renderer is rendering to.
Definition: render_interface.h:687
Describes a projection matrix fov.
Definition: xrt_defines.h:486
A tightly packed 2x2 matrix of floats.
Definition: xrt_defines.h:513
Normalized image rectangle, coordinates and size in 0 .
Definition: xrt_defines.h:453
A pose composed of a position and orientation.
Definition: xrt_defines.h:465
Very small misc utils.
#define ARRAY_SIZE(a)
Array size helper.
Definition: xrt_compiler.h:30
Common defines and enums for XRT.
Include all of the Vulkan headers in one place, and cope with any "messy" includes implied by it.