mirror of
https://github.com/recp/cglm.git
synced 2026-11-17 10:17:13 -06:00
helper fn for duplicating matrix4
This commit is contained in:
1 parent
e6ba9d6ab0
commit
dc73cab522
1 file changed
+16
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user