From 07dc9520a4b9ee442138ab2286abceaf02a64b49 Mon Sep 17 00:00:00 2001 From: myfreeer Date: Wed, 3 Jul 2024 20:04:50 +0800 Subject: [PATCH] mat4: wasm simd128 for glm_mat4_inv The function `glm_mat4_inv_wasm` has been implemented, but not used in `glm_mat4_inv`. This commit adds a conditional macro to add the case of wasm and simd128 case for calling `glm_mat4_inv_wasm`. --- include/cglm/mat4.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/cglm/mat4.h b/include/cglm/mat4.h index 742b0cb9..4d249b80 100644 --- a/include/cglm/mat4.h +++ b/include/cglm/mat4.h @@ -645,7 +645,9 @@ glm_mat4_det(mat4 mat) { CGLM_INLINE void glm_mat4_inv(mat4 mat, mat4 dest) { -#if defined( __SSE__ ) || defined( __SSE2__ ) +#if defined(__wasm__) && defined(__wasm_simd128__) + glm_mat4_inv_wasm(mat, dest); +#elif defined( __SSE__ ) || defined( __SSE2__ ) glm_mat4_inv_sse2(mat, dest); #elif defined(CGLM_NEON_FP) glm_mat4_inv_neon(mat, dest);