The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

c/util: Comments

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2220>

authored by

Rylie Pavlik and committed by
Simon Zeni
59808045 569419de

+21 -18
+21 -18
src/xrt/compositor/util/comp_render_gfx.c
··· 29 29 * 30 30 */ 31 31 32 - /* 33 - * Internal per-view for the layer shashing render step. 32 + /** 33 + * Internal per-view for the layer squashing render step. 34 34 */ 35 35 struct gfx_layer_view_state 36 36 { 37 - // Filled out descriptor sets. 37 + /// Filled out descriptor sets. 38 38 VkDescriptorSet descriptor_sets[RENDER_MAX_LAYERS]; 39 39 40 - // The type of layer. 40 + /// The type of layer. 41 41 enum xrt_layer_type types[RENDER_MAX_LAYERS]; 42 - // Is the alpha premultipled, false means unpremultiplied. 42 + 43 + /// Is the alpha premultipled, false means unpremultiplied. 43 44 bool premultiplied_alphas[RENDER_MAX_LAYERS]; 44 45 45 - // To go to this view's tangent lengths. 46 + /// To go to this view's tangent lengths. 46 47 struct xrt_normalized_rect to_tangent; 47 48 48 - // Number of layers filed in. 49 + /// Number of layers filled in. 50 + /// TODO move to parent struct 49 51 uint32_t layer_count; 50 52 51 - // Full rotation and translation VP matrix, in world space. 53 + /// Full rotation and translation VP matrix, in world space. 52 54 struct xrt_matrix_4x4 world_vp_full; 53 - // Full rotation and translation VP matrix, in view space. 55 + /// Full rotation and translation VP matrix, in view space. 54 56 struct xrt_matrix_4x4 eye_vp_full; 55 57 56 - // Full rotation and translation inverse V matrix, in world space. 58 + /// Full rotation and translation inverse V matrix, in world space. 57 59 struct xrt_matrix_4x4 world_v_inv_full; 58 - // Full rotation and translation inverse V matrix, in view space. 60 + /// Full rotation and translation inverse V matrix, in view space. 59 61 struct xrt_matrix_4x4 eye_v_inv_full; 60 62 61 - // Only rotation and translation VP matrix, in world space. 63 + /// Only rotation and translation VP matrix, in world space. 62 64 struct xrt_matrix_4x4 world_vp_rot_only; 63 - // Only rotation and translation VP matrix, in view space. 65 + /// Only rotation and translation VP matrix, in view space. 64 66 struct xrt_matrix_4x4 eye_vp_rot_only; 65 67 }; 66 68 67 - /* 68 - * Internal state for the layer squashing render step. 69 + /** 70 + * Internal state for the layer squashing render step, contains all per-view state 69 71 */ 70 72 struct gfx_layer_state 71 73 { ··· 476 478 struct vk_bundle *vk = rr->r->vk; 477 479 VkResult ret; 478 480 479 - // Hardcoded to stereo. 480 481 struct gfx_layer_state ls = XRT_STRUCT_INIT; 481 482 483 + // Compute MVP matrices per eye: populates gfx_layer_view_state elements in `ls` 484 + // from `comp_render_dispatch_data *d` 482 485 for (uint32_t view = 0; view < d->view_count; view++) { 483 486 484 487 // Data for this view, convenience. ··· 519 522 } 520 523 521 524 /* 522 - * Reserve UBOs, create descriptor sets, and fill in any data a head of 523 - * time, if we ever want to copy UBO data this lets us do that easily 525 + * Reserve UBOs, create descriptor sets, and fill in any data ahead of 526 + * time. If we ever want to copy UBO data, this lets us do that easily: 524 527 * write a copy command before the other gfx commands. 525 528 */ 526 529