From 10cdde859aaf53d6487f59568c7bda7b05ba237c Mon Sep 17 00:00:00 2001 From: Moses Date: Fri, 27 Jan 2023 12:34:39 -0600 Subject: [PATCH] a/math, comp/main, comp/render: Change math_matrix_2x2_* to m_mat2x2_* --- src/xrt/auxiliary/math/m_matrix_2x2.h | 12 +++++------- src/xrt/compositor/main/comp_renderer.c | 12 ++++++------ src/xrt/compositor/render/render_resources.c | 4 ++-- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/xrt/auxiliary/math/m_matrix_2x2.h b/src/xrt/auxiliary/math/m_matrix_2x2.h index e87020621..fee8acb46 100644 --- a/src/xrt/auxiliary/math/m_matrix_2x2.h +++ b/src/xrt/auxiliary/math/m_matrix_2x2.h @@ -18,9 +18,9 @@ extern "C" { #endif static inline void -math_matrix_2x2_multiply(const struct xrt_matrix_2x2 *left, - const struct xrt_matrix_2x2 *right, - struct xrt_matrix_2x2 *result_out) +m_mat2x2_multiply(const struct xrt_matrix_2x2 *left, + const struct xrt_matrix_2x2 *right, + struct xrt_matrix_2x2 *result_out) { const struct xrt_matrix_2x2 l = *left; const struct xrt_matrix_2x2 r = *right; @@ -37,9 +37,7 @@ math_matrix_2x2_multiply(const struct xrt_matrix_2x2 *left, } static inline void -math_matrix_2x2_transform_vec2(const struct xrt_matrix_2x2 *left, - const struct xrt_vec2 *right, - struct xrt_vec2 *result_out) +m_mat2x2_transform_vec2(const struct xrt_matrix_2x2 *left, const struct xrt_vec2 *right, struct xrt_vec2 *result_out) { const struct xrt_matrix_2x2 l = *left; const struct xrt_vec2 r = *right; @@ -48,7 +46,7 @@ math_matrix_2x2_transform_vec2(const struct xrt_matrix_2x2 *left, } static inline void -math_matrix_2x2_invert(const struct xrt_matrix_2x2 *matrix, struct xrt_matrix_2x2 *invertedMatrix) +m_mat2x2_invert(const struct xrt_matrix_2x2 *matrix, struct xrt_matrix_2x2 *invertedMatrix) { float determinant = matrix->v[0] * matrix->v[3] - matrix->v[1] * matrix->v[2]; invertedMatrix->v[0] = matrix->v[3] / determinant; diff --git a/src/xrt/compositor/main/comp_renderer.c b/src/xrt/compositor/main/comp_renderer.c index 43335bbee..7f48f4b00 100644 --- a/src/xrt/compositor/main/comp_renderer.c +++ b/src/xrt/compositor/main/comp_renderer.c @@ -299,12 +299,12 @@ renderer_build_rendering(struct comp_renderer *r, }}; if (pre_rotate) { - math_matrix_2x2_multiply(&distortion_data[0].vertex_rot, // - &rotation_90_cw, // - &distortion_data[0].vertex_rot); // - math_matrix_2x2_multiply(&distortion_data[1].vertex_rot, // - &rotation_90_cw, // - &distortion_data[1].vertex_rot); // + m_mat2x2_multiply(&distortion_data[0].vertex_rot, // + &rotation_90_cw, // + &distortion_data[0].vertex_rot); // + m_mat2x2_multiply(&distortion_data[1].vertex_rot, // + &rotation_90_cw, // + &distortion_data[1].vertex_rot); // } render_gfx_update_distortion(rr, // diff --git a/src/xrt/compositor/render/render_resources.c b/src/xrt/compositor/render/render_resources.c index 380705e3b..29e7b8c5a 100644 --- a/src/xrt/compositor/render/render_resources.c +++ b/src/xrt/compositor/render/render_resources.c @@ -602,7 +602,7 @@ create_and_fill_in_distortion_buffer_for_view(struct vk_bundle *vk, }}; if (pre_rotate) { - math_matrix_2x2_multiply(&rot, &rotation_90_cw, &rot); + m_mat2x2_multiply(&rot, &rotation_90_cw, &rot); } VkDeviceSize size = sizeof(struct texture); @@ -631,7 +631,7 @@ create_and_fill_in_distortion_buffer_for_view(struct vk_bundle *vk, // These need to go from -0.5 to 0.5 for the rotation struct xrt_vec2 uv = {u - 0.5f, v - 0.5f}; - math_matrix_2x2_transform_vec2(&rot, &uv, &uv); + m_mat2x2_transform_vec2(&rot, &uv, &uv); uv.x += 0.5f; uv.y += 0.5f;