mirror of
https://github.com/g-truc/glm.git
synced 2025-04-10 07:18:54 +00:00
Fixed constexpr with SIMD interaction
This commit is contained in:
parent
92a46735d6
commit
a6047251be
4 changed files with 15 additions and 9 deletions
|
@ -737,11 +737,17 @@
|
|||
# define GLM_RELAXED_CONSTEXPR const
|
||||
#endif
|
||||
|
||||
#if GLM_ARCH == GLM_ARCH_PURE
|
||||
# define GLM_CONSTEXPR_SIMD GLM_CONSTEXPR
|
||||
#else
|
||||
# define GLM_CONSTEXPR_SIMD
|
||||
#endif
|
||||
|
||||
// GCC 4.6 has a bug causing a compiler crash
|
||||
#if GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# define GLM_CONSTEXPR_GCC
|
||||
# define GLM_CONSTEXPR_GCC
|
||||
#else
|
||||
# define GLM_CONSTEXPR_GCC GLM_CONSTEXPR
|
||||
# define GLM_CONSTEXPR_GCC GLM_CONSTEXPR
|
||||
#endif
|
||||
|
||||
#ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
|
|
|
@ -158,8 +158,8 @@ namespace detail
|
|||
// -- Explicit basic constructors --
|
||||
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec4(ctor);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_GCC explicit tvec4(T scalar);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tvec4(T a, T b, T c, T d);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD explicit tvec4(T scalar);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec4(T a, T b, T c, T d);
|
||||
|
||||
// -- Conversion scalar constructors --
|
||||
|
||||
|
|
|
@ -63,12 +63,12 @@ namespace glm
|
|||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_GCC tvec4<T, P>::tvec4(T scalar)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<T, P>::tvec4(T scalar)
|
||||
: x(scalar), y(scalar), z(scalar), w(scalar)
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(T a, T b, T c, T d)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<T, P>::tvec4(T a, T b, T c, T d)
|
||||
: x(a), y(b), z(c), w(d)
|
||||
{}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace glm
|
|||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<float, simd>::tvec4()
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<float, simd>::tvec4()
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
: data(_mm_setzero_ps())
|
||||
# endif
|
||||
|
@ -44,12 +44,12 @@ namespace glm
|
|||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_GCC tvec4<float, simd>::tvec4(float s) :
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, simd>::tvec4(float s) :
|
||||
data(_mm_set1_ps(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<float, simd>::tvec4(float a, float b, float c, float d) :
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, simd>::tvec4(float a, float b, float c, float d) :
|
||||
data(_mm_set_ps(d, c, b, a))
|
||||
{}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue