mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
improve glm_mat4_mulN for non-DEBUG environment
This commit is contained in:
@@ -47,7 +47,7 @@ glmc_mat4_mul(mat4 m1, mat4 m2, mat4 dest);
|
|||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_mat4_mulN(mat4 * __restrict matrices[], int len, mat4 dest);
|
glmc_mat4_mulN(mat4 * __restrict matrices[], uint32_t len, mat4 dest);
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -58,7 +58,9 @@
|
|||||||
# include "simd/neon/mat4.h"
|
# include "simd/neon/mat4.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
# include <assert.h>
|
# include <assert.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define GLM_MAT4_IDENTITY_INIT {{1.0f, 0.0f, 0.0f, 0.0f}, \
|
#define GLM_MAT4_IDENTITY_INIT {{1.0f, 0.0f, 0.0f, 0.0f}, \
|
||||||
{0.0f, 1.0f, 0.0f, 0.0f}, \
|
{0.0f, 1.0f, 0.0f, 0.0f}, \
|
||||||
@@ -281,19 +283,17 @@ glm_mat4_mul(mat4 m1, mat4 m2, mat4 dest) {
|
|||||||
*/
|
*/
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_mat4_mulN(mat4 * __restrict matrices[], int len, mat4 dest) {
|
glm_mat4_mulN(mat4 * __restrict matrices[], uint32_t len, mat4 dest) {
|
||||||
int i;
|
uint32_t i;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
assert(len > 1 && "there must be least 2 matrices to go!");
|
assert(len > 1 && "there must be least 2 matrices to go!");
|
||||||
|
#endif
|
||||||
|
|
||||||
glm_mat4_mul(*matrices[0],
|
glm_mat4_mul(*matrices[0], *matrices[1], dest);
|
||||||
*matrices[1],
|
|
||||||
dest);
|
|
||||||
|
|
||||||
for (i = 2; i < len; i++)
|
for (i = 2; i < len; i++)
|
||||||
glm_mat4_mul(dest,
|
glm_mat4_mul(dest, *matrices[i], dest);
|
||||||
*matrices[i],
|
|
||||||
dest);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ glmc_mat4_mul(mat4 m1, mat4 m2, mat4 dest) {
|
|||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_mat4_mulN(mat4 * __restrict matrices[], int len, mat4 dest) {
|
glmc_mat4_mulN(mat4 * __restrict matrices[], uint32_t len, mat4 dest) {
|
||||||
glm_mat4_mulN(matrices, len, dest);
|
glm_mat4_mulN(matrices, len, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user