optimize matrix4x4 inverse for SSE2

This commit is contained in:
Recep Aslantas
2016-09-16 20:24:55 +03:00
parent 55c1f93388
commit 253f5ba5f6
3 changed files with 107 additions and 0 deletions

View File

@@ -178,6 +178,9 @@ glm_mat4_det(mat4 mat) {
CGLM_INLINE
void
glm_mat4_inv(mat4 mat, mat4 dest) {
#if defined( __SSE__ ) || defined( __SSE2__ )
glm_mat4_inv_see2(mat, dest);
#else
float t[6];
float det;
float a, b, c, d,
@@ -223,6 +226,7 @@ glm_mat4_inv(mat4 mat, mat4 dest) {
+ c * dest[2][0] + d * dest[3][0]);
glm_mat4_scale_p(dest, det);
#endif
}
#endif /* cglm_mat_h */