From 72bf05e06e2a589f750f723fe35e9549ef9755bd Mon Sep 17 00:00:00 2001 From: Groove Date: Sat, 18 Aug 2018 13:58:30 +0200 Subject: [PATCH] Clean up detection --- glm/detail/setup.hpp | 26 +++++++++++++++----------- glm/detail/type_vec4_simd.inl | 4 ---- test/gtx/gtx_load.cpp | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index dc2fbdab..2d1953f6 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -448,9 +448,13 @@ #define GLM_SWIZZLE_OPERATOR 1 #define GLM_SWIZZLE_FUNCTION 2 -#if defined(GLM_FORCE_SWIZZLE) && !defined(GLM_FORCE_XYZW_ONLY) && (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) +#if defined(GLM_FORCE_XYZW_ONLY) +# undef GLM_FORCE_SWIZZLE +#endif + +#if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR -#elif defined(GLM_FORCE_SWIZZLE) && !defined(GLM_FORCE_XYZW_ONLY) +#elif defined(GLM_FORCE_SWIZZLE) # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION #else # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_DISABLED @@ -718,6 +722,15 @@ namespace detail }//namespace glm #endif +/////////////////////////////////////////////////////////////////////////////////// +// Only use x, y, z, w as vector type components + +#ifdef GLM_FORCE_XYZW_ONLY +# define GLM_CONFIG_XYZW_ONLY GLM_ENABLE +#else +# define GLM_CONFIG_XYZW_ONLY GLM_DISABLE +#endif + /////////////////////////////////////////////////////////////////////////////////// // Configure the use of defaulted initialized types @@ -761,15 +774,6 @@ namespace detail # define GLM_CONFIG_SIMD GLM_DISABLE #endif -/////////////////////////////////////////////////////////////////////////////////// -// Only use x, y, z, w as vector type components - -#ifdef GLM_FORCE_XYZW_ONLY -# define GLM_CONFIG_XYZW_ONLY GLM_ENABLE -#else -# define GLM_CONFIG_XYZW_ONLY GLM_DISABLE -#endif - /////////////////////////////////////////////////////////////////////////////////// // Configure the use of anonymous structure as implementation detail diff --git a/glm/detail/type_vec4_simd.inl b/glm/detail/type_vec4_simd.inl index 4f28b205..34f770b9 100644 --- a/glm/detail/type_vec4_simd.inl +++ b/glm/detail/type_vec4_simd.inl @@ -144,7 +144,6 @@ namespace detail }; # endif -# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE template<> struct compute_vec4_div { @@ -155,7 +154,6 @@ namespace detail return Result; } }; -# endif template struct compute_vec4_and @@ -342,7 +340,6 @@ namespace detail }; }//namespace detail -# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE template<> GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(float _s) : data(_mm_set1_ps(_s)) @@ -457,7 +454,6 @@ namespace detail GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(int _x, int _y, int _z, int _w) : data(_mm_cvtepi32_ps(_mm_set_epi32(_w, _z, _y, _x))) {} -#endif// GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE }//namespace glm #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/test/gtx/gtx_load.cpp b/test/gtx/gtx_load.cpp index cc0069c5..1467b9b1 100644 --- a/test/gtx/gtx_load.cpp +++ b/test/gtx/gtx_load.cpp @@ -1,7 +1,7 @@ #define GLM_ENABLE_EXPERIMENTAL #include /* -#if GLM_CONFIG_SIMD == GLM_ENABLE && GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +#if GLM_CONFIG_SIMD == GLM_ENABLE #include #include @@ -116,7 +116,7 @@ int main() { int Error = 0; /* -# if GLM_CONFIG_SIMD == GLM_ENABLE && GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +# if GLM_CONFIG_SIMD == GLM_ENABLE Error += test_vec4_load(); # endif */