mirror of
https://github.com/recp/cglm.git
synced 2025-12-25 12:55:04 +00:00
arm, neon: neon/fma support for glm_inv_tr()
This commit is contained in:
@@ -7,6 +7,25 @@
|
||||
|
||||
#include "test_common.h"
|
||||
|
||||
#ifndef glm_affine_mat_test_guard
|
||||
#define glm_affine_mat_test_guard
|
||||
CGLM_INLINE
|
||||
void
|
||||
glm_inv_tr_raw(mat4 mat) {
|
||||
CGLM_ALIGN_MAT mat3 r;
|
||||
CGLM_ALIGN(8) vec3 t;
|
||||
|
||||
/* rotate */
|
||||
glm_mat4_pick3t(mat, r);
|
||||
glm_mat4_ins3(r, mat);
|
||||
|
||||
/* translate */
|
||||
glm_mat3_mulv(r, mat[3], t);
|
||||
glm_vec3_negate(t);
|
||||
glm_vec3_copy(t, mat[3]);
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_IMPL(GLM_PREFIX, mul) {
|
||||
mat4 m1 = GLM_MAT4_IDENTITY_INIT;
|
||||
mat4 m2 = GLM_MAT4_IDENTITY_INIT;
|
||||
@@ -81,6 +100,12 @@ TEST_IMPL(GLM_PREFIX, inv_tr) {
|
||||
GLM(mat4_inv)(m1, m2);
|
||||
GLM(inv_tr)(m2);
|
||||
ASSERTIFY(test_assert_mat4_eq(m1, m2))
|
||||
|
||||
/* test with raw */
|
||||
glm_mat4_copy(m1, m2);
|
||||
glm_inv_tr_raw(m2);
|
||||
GLM(inv_tr)(m1);
|
||||
ASSERTIFY(test_assert_mat4_eq(m1, m2))
|
||||
}
|
||||
|
||||
TEST_SUCCESS
|
||||
|
||||
Reference in New Issue
Block a user