helper fn for duplicating matrix4

This commit is contained in:
Recep Aslantas
2016-09-27 16:50:09 +03:00
parent e6ba9d6ab0
commit dc73cab522

View File

@@ -20,6 +20,22 @@
#define GLM_MAT4_IDENTITY (mat4)GLM_MAT4_IDENTITY_INIT
CGLM_INLINE
void
glm_mat4_dup(mat4 mat, mat4 dest) {
#ifdef __AVX__
_mm256_store_ps(dest[0], _mm256_load_ps(mat[0]));
_mm256_store_ps(dest[2], _mm256_load_ps(mat[2]));
#elif defined( __SSE__ ) || defined( __SSE2__ )
_mm_store_ps(dest[0], _mm_load_ps(mat[0]));
_mm_store_ps(dest[1], _mm_load_ps(mat[1]));
_mm_store_ps(dest[2], _mm_load_ps(mat[2]));
_mm_store_ps(dest[3], _mm_load_ps(mat[3]));
#else
glm__memcpy(float, dest, mat, sizeof(mat4));
#endif
}
CGLM_INLINE
void
glm_mat4_mul(mat4 l, mat4 r, mat4 d) {