The OpenGL mathematics library defines a macro GLM_CONSTEXPR_SIMD
which causes expressions like vec3(1.0f, 0.0f, 0.0f, 1.0f)
to be a constexpr
only when generating platform-independent code, i.e., only whenGLM_ARCH
is GLM_ARCH_PURE
.
I assume this is done for performance reasons, but why would making something non-constexpr
increase performance? And how does SIMD play a role in the decision?