···2929 *
3030 */
31313232-/*
3333- * Internal per-view for the layer shashing render step.
3232+/**
3333+ * Internal per-view for the layer squashing render step.
3434 */
3535struct gfx_layer_view_state
3636{
3737- // Filled out descriptor sets.
3737+ /// Filled out descriptor sets.
3838 VkDescriptorSet descriptor_sets[RENDER_MAX_LAYERS];
39394040- // The type of layer.
4040+ /// The type of layer.
4141 enum xrt_layer_type types[RENDER_MAX_LAYERS];
4242- // Is the alpha premultipled, false means unpremultiplied.
4242+4343+ /// Is the alpha premultipled, false means unpremultiplied.
4344 bool premultiplied_alphas[RENDER_MAX_LAYERS];
44454545- // To go to this view's tangent lengths.
4646+ /// To go to this view's tangent lengths.
4647 struct xrt_normalized_rect to_tangent;
47484848- // Number of layers filed in.
4949+ /// Number of layers filled in.
5050+ /// TODO move to parent struct
4951 uint32_t layer_count;
50525151- // Full rotation and translation VP matrix, in world space.
5353+ /// Full rotation and translation VP matrix, in world space.
5254 struct xrt_matrix_4x4 world_vp_full;
5353- // Full rotation and translation VP matrix, in view space.
5555+ /// Full rotation and translation VP matrix, in view space.
5456 struct xrt_matrix_4x4 eye_vp_full;
55575656- // Full rotation and translation inverse V matrix, in world space.
5858+ /// Full rotation and translation inverse V matrix, in world space.
5759 struct xrt_matrix_4x4 world_v_inv_full;
5858- // Full rotation and translation inverse V matrix, in view space.
6060+ /// Full rotation and translation inverse V matrix, in view space.
5961 struct xrt_matrix_4x4 eye_v_inv_full;
60626161- // Only rotation and translation VP matrix, in world space.
6363+ /// Only rotation and translation VP matrix, in world space.
6264 struct xrt_matrix_4x4 world_vp_rot_only;
6363- // Only rotation and translation VP matrix, in view space.
6565+ /// Only rotation and translation VP matrix, in view space.
6466 struct xrt_matrix_4x4 eye_vp_rot_only;
6567};
66686767-/*
6868- * Internal state for the layer squashing render step.
6969+/**
7070+ * Internal state for the layer squashing render step, contains all per-view state
6971 */
7072struct gfx_layer_state
7173{
···476478 struct vk_bundle *vk = rr->r->vk;
477479 VkResult ret;
478480479479- // Hardcoded to stereo.
480481 struct gfx_layer_state ls = XRT_STRUCT_INIT;
481482483483+ // Compute MVP matrices per eye: populates gfx_layer_view_state elements in `ls`
484484+ // from `comp_render_dispatch_data *d`
482485 for (uint32_t view = 0; view < d->view_count; view++) {
483486484487 // Data for this view, convenience.
···519522 }
520523521524 /*
522522- * Reserve UBOs, create descriptor sets, and fill in any data a head of
523523- * time, if we ever want to copy UBO data this lets us do that easily
525525+ * Reserve UBOs, create descriptor sets, and fill in any data ahead of
526526+ * time. If we ever want to copy UBO data, this lets us do that easily:
524527 * write a copy command before the other gfx commands.
525528 */
526529