unaligned matrix duplication

This commit is contained in:
Recep Aslantas
2016-10-06 16:54:08 +03:00
parent 1b41c3d52a
commit 78e4e867eb

View File

@@ -26,6 +26,21 @@
/* for C only */
#define GLM_MAT4_IDENTITY (mat4)GLM_MAT4_IDENTITY_INIT
/*!
* @brief copy all members of [mat] to [dest]
*
* matrix may not be aligned, u stands for unaligned, this may be useful when
* copying a matrix from external source e.g. asset importer...
*
* @param[in] mat source
* @param[out] dest destination
*/
CGLM_INLINE
void
glm_mat4_udup(mat4 mat, mat4 dest) {
glm__memcpy(float, dest, mat, sizeof(mat4));
}
/*!
* @brief copy all members of [mat] to [dest]
*
@@ -44,7 +59,7 @@ glm_mat4_dup(mat4 mat, mat4 dest) {
_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));
glm_mat4_udup(mat, dest);
#endif
}