c/util: Add to_tangent for view state

This commit is contained in:
Jakob Bornecrantz 2023-10-20 22:27:26 +01:00
parent 0d0addca82
commit 669e37220c

View file

@ -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);