Fix alignment issue when using AVX

This commit is contained in:
Jonathan Platzer
2018-07-18 12:00:46 +02:00
parent 3738499927
commit 2d63d7e0cd
2 changed files with 8 additions and 2 deletions

View File

@@ -139,7 +139,7 @@ glm_mat4_copy(mat4 mat, mat4 dest) {
CGLM_INLINE
void
glm_mat4_identity(mat4 mat) {
CGLM_ALIGN(16) mat4 t = GLM_MAT4_IDENTITY_INIT;
mat4 t = GLM_MAT4_IDENTITY_INIT;
glm_mat4_copy(t, mat);
}

View File

@@ -31,8 +31,14 @@ typedef CGLM_ALIGN_IF(8) float vec3[3];
typedef int ivec3[3];
typedef CGLM_ALIGN_IF(16) float vec4[4];
typedef vec3 mat3[3];
#ifdef __AVX__
typedef CGLM_ALIGN_IF(32) vec3 mat3[3];
typedef CGLM_ALIGN_IF(32) vec4 mat4[4];
#else
typedef vec3 mat3[3];
typedef CGLM_ALIGN_IF(16) vec4 mat4[4];
#endif
typedef vec4 versor;