From 669e37220c39bc5c99271b41408b5a3e101c228c Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 20 Oct 2023 22:27:26 +0100 Subject: [PATCH] c/util: Add to_tangent for view state --- src/xrt/compositor/util/comp_render_gfx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xrt/compositor/util/comp_render_gfx.c b/src/xrt/compositor/util/comp_render_gfx.c index ca7e0fc48..7c6c8b119 100644 --- a/src/xrt/compositor/util/comp_render_gfx.c +++ b/src/xrt/compositor/util/comp_render_gfx.c @@ -42,6 +42,9 @@ struct gfx_view_state // Is the alpha premultipled, false means unpremultiplied. bool premultiplied_alphas[RENDER_MAX_LAYERS]; + // To go to this view's tangent lengths. + struct xrt_normalized_rect to_tangent; + // Number of layers filed in. uint32_t layer_count; @@ -294,6 +297,9 @@ do_layers(struct render_gfx *rr, for (uint32_t view = 0; view < ARRAY_SIZE(views); view++) { + // Used to go from UV to tangent space. + render_calc_uv_to_tangent_lengths_rect(&new_fovs[view], &views[view].to_tangent); + // Projection struct xrt_matrix_4x4 p; math_matrix_4x4_projection_vulkan_infinite_reverse(&new_fovs[view], 0.1, &p);