From 4e574af7ac1eca760bfd9757238ee5550306815d Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 Jul 2018 18:45:43 +0200 Subject: [PATCH 01/14] Fixed GLM_USE_ALIGNED_GENTYPES initialization --- glm/detail/setup.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index c8ad0c90..137afcc4 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -639,7 +639,7 @@ namespace glm /////////////////////////////////////////////////////////////////////////////////// // Enable aligned gentypes -#if defined(GLM_FORCE_ALIGNED_GENTYPES) && GLM_HAS_ALIGNOF +#if defined(GLM_FORCE_ALIGNED_GENTYPES) && GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) # define GLM_USE_ALIGNED_GENTYPES GLM_ENABLE #else # define GLM_USE_ALIGNED_GENTYPES GLM_DISABLE From 96bf3c0d956aaa55489c6c20eacc325d9b1209b7 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 Jul 2018 18:53:10 +0200 Subject: [PATCH 02/14] Removed GLM_FORCE_SWIZZLE and GLM_FORCE_UNRESTRICTED_GENTYPE restriction --- glm/detail/setup.hpp | 7 ------- test/core/core_force_unrestricted_gentype.cpp | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 137afcc4..a4f5f6fb 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -35,13 +35,6 @@ #include "../simd/platform.h" -/////////////////////////////////////////////////////////////////////////////////// -// Incompatible GLM_FORCE defines - -#if defined(GLM_FORCE_SWIZZLE) && defined(GLM_FORCE_UNRESTRICTED_GENTYPE) -# error "Both GLM_FORCE_SWIZZLE and GLM_FORCE_UNRESTRICTED_GENTYPE can't be defined at the same time" -#endif - /////////////////////////////////////////////////////////////////////////////////// // Build model diff --git a/test/core/core_force_unrestricted_gentype.cpp b/test/core/core_force_unrestricted_gentype.cpp index 46a8b1ed..f198fa33 100644 --- a/test/core/core_force_unrestricted_gentype.cpp +++ b/test/core/core_force_unrestricted_gentype.cpp @@ -1,4 +1,5 @@ #define GLM_FORCE_UNRESTRICTED_GENTYPE +#define GLM_FORCE_SWIZZLE #include From 0dcb1e8a90953e58809ec5fd5942b5e7bbf91037 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 Jul 2018 18:56:23 +0200 Subject: [PATCH 03/14] Removed extra GLM_FORCE_MESSAGES --- test/core/core_func_swizzle.cpp | 1 - test/core/core_setup_message.cpp | 1 - test/gtc/gtc_type_aligned.cpp | 1 - 3 files changed, 3 deletions(-) diff --git a/test/core/core_func_swizzle.cpp b/test/core/core_func_swizzle.cpp index c3a5fac7..100d39e4 100644 --- a/test/core/core_func_swizzle.cpp +++ b/test/core/core_func_swizzle.cpp @@ -1,4 +1,3 @@ -#define GLM_FORCE_MESSAGES #define GLM_FORCE_SWIZZLE #include diff --git a/test/core/core_setup_message.cpp b/test/core/core_setup_message.cpp index 30eba30d..2908ada3 100644 --- a/test/core/core_setup_message.cpp +++ b/test/core/core_setup_message.cpp @@ -1,4 +1,3 @@ -#define GLM_FORCE_MESSAGES #include #include diff --git a/test/gtc/gtc_type_aligned.cpp b/test/gtc/gtc_type_aligned.cpp index da2dbd2c..41292cda 100644 --- a/test/gtc/gtc_type_aligned.cpp +++ b/test/gtc/gtc_type_aligned.cpp @@ -1,4 +1,3 @@ -#define GLM_FORCE_MESSAGES #define GLM_FORCE_ALIGNED_GENTYPES #include From 1644f0f489a86817f8ef3b6feed84760fe3b52fe Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 Jul 2018 18:59:09 +0200 Subject: [PATCH 04/14] Removed restriction #if defined(GLM_FORCE_UNRESTRICTED_GENTYPE) --- glm/detail/setup.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index a4f5f6fb..351323dd 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -226,9 +226,7 @@ #endif // N2346 -#if defined(GLM_FORCE_UNRESTRICTED_GENTYPE) -# define GLM_HAS_DEFAULTED_FUNCTIONS 0 -#elif GLM_COMPILER & GLM_COMPILER_CLANG +#if GLM_COMPILER & GLM_COMPILER_CLANG # define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_DEFAULTED_FUNCTIONS 1 From b6321cb85e14a07934c368bcc1f16df1bd8c5d5d Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 Jul 2018 19:38:57 +0200 Subject: [PATCH 05/14] Clean up configuration defines --- glm/detail/func_common.inl | 2 +- glm/detail/func_exponential.inl | 2 +- glm/detail/func_geometric.inl | 2 +- glm/detail/func_integer.inl | 2 +- glm/detail/func_matrix.inl | 2 +- glm/detail/func_packing.inl | 2 +- glm/detail/func_trigonometric.inl | 2 +- glm/detail/func_vector_relational.inl | 2 +- glm/detail/setup.hpp | 54 ++++++++++++++++++--------- glm/detail/type_mat2x2.inl | 6 +-- glm/detail/type_mat2x3.inl | 6 +-- glm/detail/type_mat2x4.inl | 6 +-- glm/detail/type_mat3x2.inl | 6 +-- glm/detail/type_mat3x3.inl | 8 ++-- glm/detail/type_mat3x4.inl | 6 +-- glm/detail/type_mat4x2.inl | 6 +-- glm/detail/type_mat4x3.inl | 6 +-- glm/detail/type_mat4x4.inl | 8 ++-- glm/detail/type_vec1.inl | 2 +- glm/detail/type_vec2.inl | 2 +- glm/detail/type_vec3.inl | 2 +- glm/detail/type_vec4.inl | 4 +- glm/gtc/quaternion.inl | 2 +- glm/gtx/dual_quaternion.inl | 2 +- 24 files changed, 81 insertions(+), 61 deletions(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 2de9e4a2..ee0592df 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -781,6 +781,6 @@ namespace detail } }//namespace glm -#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT) +#if GLM_USE_SIMD == GLM_ENABLE # include "func_common_simd.inl" #endif diff --git a/glm/detail/func_exponential.inl b/glm/detail/func_exponential.inl index 808d6907..a847e63f 100644 --- a/glm/detail/func_exponential.inl +++ b/glm/detail/func_exponential.inl @@ -146,7 +146,7 @@ namespace detail } }//namespace glm -#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT) +#if GLM_USE_SIMD == GLM_ENABLE # include "func_exponential_simd.inl" #endif diff --git a/glm/detail/func_geometric.inl b/glm/detail/func_geometric.inl index 0408a8be..cc9e57df 100644 --- a/glm/detail/func_geometric.inl +++ b/glm/detail/func_geometric.inl @@ -242,6 +242,6 @@ namespace detail } }//namespace glm -#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT) +#if GLM_USE_SIMD == GLM_ENABLE # include "func_geometric_simd.inl" #endif diff --git a/glm/detail/func_integer.inl b/glm/detail/func_integer.inl index 6adc57d9..d02a5e1b 100644 --- a/glm/detail/func_integer.inl +++ b/glm/detail/func_integer.inl @@ -372,7 +372,7 @@ namespace detail } }//namespace glm -#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT) +#if GLM_USE_SIMD == GLM_ENABLE # include "func_integer_simd.inl" #endif diff --git a/glm/detail/func_matrix.inl b/glm/detail/func_matrix.inl index 6a0a41c5..c946f0a9 100644 --- a/glm/detail/func_matrix.inl +++ b/glm/detail/func_matrix.inl @@ -395,7 +395,7 @@ namespace detail } }//namespace glm -#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT) +#if GLM_USE_SIMD == GLM_ENABLE # include "func_matrix_simd.inl" #endif diff --git a/glm/detail/func_packing.inl b/glm/detail/func_packing.inl index 94875680..1904d968 100644 --- a/glm/detail/func_packing.inl +++ b/glm/detail/func_packing.inl @@ -184,7 +184,7 @@ namespace glm } }//namespace glm -#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT) +#if GLM_USE_SIMD == GLM_ENABLE # include "func_packing_simd.inl" #endif diff --git a/glm/detail/func_trigonometric.inl b/glm/detail/func_trigonometric.inl index 6306456d..8571a524 100644 --- a/glm/detail/func_trigonometric.inl +++ b/glm/detail/func_trigonometric.inl @@ -194,7 +194,7 @@ namespace glm } }//namespace glm -#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT) +#if GLM_USE_SIMD == GLM_ENABLE # include "func_trigonometric_simd.inl" #endif diff --git a/glm/detail/func_vector_relational.inl b/glm/detail/func_vector_relational.inl index ba2e06d6..7c66125a 100644 --- a/glm/detail/func_vector_relational.inl +++ b/glm/detail/func_vector_relational.inl @@ -100,6 +100,6 @@ namespace glm } }//namespace glm -#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT) +#if GLM_USE_SIMD == GLM_ENABLE # include "func_vector_relational_simd.inl" #endif diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 351323dd..c71e9c2a 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -564,20 +564,6 @@ /////////////////////////////////////////////////////////////////////////////////// -#ifdef GLM_FORCE_NO_CTOR_INIT -# undef GLM_FORCE_CTOR_INIT -#endif - -#if GLM_HAS_DEFAULTED_FUNCTIONS && !defined(GLM_FORCE_CTOR_INIT) -# define GLM_USE_DEFAULTED_FUNCTIONS GLM_ENABLE -# define GLM_DEFAULT = default -#else -# define GLM_USE_DEFAULTED_FUNCTIONS GLM_DISABLE -# define GLM_DEFAULT -#endif - -/////////////////////////////////////////////////////////////////////////////////// - #ifdef GLM_FORCE_EXPLICIT_CTOR # define GLM_EXPLICIT explicit #else @@ -628,7 +614,32 @@ namespace glm #elif GLM_SETUP_INCLUDED == GLM_VERSION /////////////////////////////////////////////////////////////////////////////////// -// Enable aligned gentypes +// Configure the use of defaulted initialized types + +#define GLM_CTOR_INITIALIZER_LIST (1 << 1) +#define GLM_CTOR_INITIALISATION (1 << 2) + +#if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS +# define GLM_USE_CTOR_INIT GLM_CTOR_INITIALIZER_LIST +#elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS +# define GLM_USE_CTOR_INIT GLM_CTOR_INITIALISATION +#else +# define GLM_USE_CTOR_INIT GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of defaulted function + +#if GLM_HAS_DEFAULTED_FUNCTIONS && GLM_USE_CTOR_INIT == GLM_DISABLE +# define GLM_USE_DEFAULTED_FUNCTIONS GLM_ENABLE +# define GLM_DEFAULT = default +#else +# define GLM_USE_DEFAULTED_FUNCTIONS GLM_DISABLE +# define GLM_DEFAULT +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of aligned gentypes #if defined(GLM_FORCE_ALIGNED_GENTYPES) && GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) # define GLM_USE_ALIGNED_GENTYPES GLM_ENABLE @@ -637,9 +648,18 @@ namespace glm #endif /////////////////////////////////////////////////////////////////////////////////// -// Implementation detail +// Use SIMD instruction sets + +#if (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT) +#define GLM_USE_SIMD GLM_ENABLE +#else +#define GLM_USE_SIMD GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of anonymous structure as implementation detail -#if (((GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)) || (GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE)) +#if ((GLM_USE_SIMD == GLM_ENABLE) || (GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE)) # define GLM_USE_ANONYMOUS_STRUCT GLM_ENABLE #else # define GLM_USE_ANONYMOUS_STRUCT GLM_DISABLE diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index d46290f5..316e3b18 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -7,14 +7,14 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 2, T, Q>::mat() -# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0), col_type(0, 1)} # endif { -# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0); this->value[1] = col_type(0, 1); # endif diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index 5580f3ae..19deae35 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -5,14 +5,14 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 3, T, Q>::mat() -# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0, 0), col_type(0, 1, 0)} # endif { -# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0); this->value[1] = col_type(0, 1, 0); # endif diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index 251d90a6..439ac1de 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -5,14 +5,14 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 4, T, Q>::mat() -# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0)} # endif { -# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0, 0); this->value[1] = col_type(0, 1, 0, 0); # endif diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index 53e82229..b1d1c48e 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -5,14 +5,14 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 2, T, Q>::mat() -# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0), col_type(0, 1), col_type(0, 0)} # endif { -# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0); this->value[1] = col_type(0, 1); this->value[2] = col_type(0, 0); diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index a72eb6d6..ad8c96e7 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -7,15 +7,15 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q>::mat() -# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1)} # endif { -# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(1, 0, 0); +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0); this->value[1] = col_type(0, 1, 0); this->value[2] = col_type(0, 0, 1); # endif diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index 8a722ffd..dc5d6ddb 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -5,14 +5,14 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 4, T, Q>::mat() -# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0)} # endif { -# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0, 0); this->value[1] = col_type(0, 1, 0, 0); this->value[2] = col_type(0, 0, 1, 0); diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index 176e18fc..44fb77f7 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -5,14 +5,14 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 2, T, Q>::mat() -# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0), col_type(0, 1), col_type(0, 0), col_type(0, 0)} # endif { -# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0); this->value[1] = col_type(0, 1); this->value[2] = col_type(0, 0); diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index b7b408b5..c9f9a620 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -5,14 +5,14 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 3, T, Q>::mat() -# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1), col_type(0, 0, 0)} # endif { -# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0); this->value[1] = col_type(0, 1, 0); this->value[2] = col_type(0, 0, 1); diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index d98bf3b0..99844f7a 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -7,14 +7,14 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 4, T, Q>::mat() -# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} # endif { -# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS +# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0, 0); this->value[1] = col_type(0, 1, 0, 0); this->value[2] = col_type(0, 0, 1, 0); @@ -704,6 +704,6 @@ namespace glm } }//namespace glm -#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT) +#if GLM_USE_SIMD == GLM_ENABLE # include "type_mat4x4_simd.inl" #endif diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index 918f0616..9a3ebe9e 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -8,7 +8,7 @@ namespace glm # if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<1, T, Q>::vec() -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE : x(0) # endif {} diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index bcd50d09..3ae7135a 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -10,7 +10,7 @@ namespace glm # if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<2, T, Q>::vec() -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE : x(0), y(0) # endif {} diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index b01dfe75..29dc1c8a 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -8,7 +8,7 @@ namespace glm # if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<3, T, Q>::vec() -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE : x(0), y(0), z(0) # endif {} diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 0422d8c3..7ca1f6db 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -161,7 +161,7 @@ namespace detail # if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<4, T, Q>::vec() -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE : x(0), y(0), z(0), w(0) # endif {} @@ -1142,6 +1142,6 @@ namespace detail } }//namespace glm -#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT) +#if GLM_USE_SIMD == GLM_ENABLE # include "type_vec4_simd.inl" #endif diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 16357786..173a71d3 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -87,7 +87,7 @@ namespace detail # if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 tquat::tquat() -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE : x(0), y(0), z(0), w(1) # endif {} diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index b0dea070..58e00be5 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -27,7 +27,7 @@ namespace glm # if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 tdualquat::tdualquat() -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE : real(tquat()) , dual(tquat(0, 0, 0, 0)) # endif From bb0f4ef324435b19fcecb47cb9083c177c3f7185 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 Jul 2018 20:05:12 +0200 Subject: [PATCH 06/14] Fixed build error --- CMakeLists.txt | 2 +- glm/detail/setup.hpp | 60 +++++++--------------------------- test/bug/bug_ms_vec_static.cpp | 2 +- 3 files changed, 13 insertions(+), 51 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b87a8eb..eff478e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,7 +155,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") message("GLM: Visual C++ - ${CMAKE_CXX_COMPILER_ID} compiler") - add_compile_options(/FAs /W4 /WX) + add_compile_options(/W4 /WX) add_compile_options(/wd4309 /wd4324 /wd4389 /wd4127 /wd4267 /wd4146 /wd4201 /wd4464 /wd4514 /wd4701 /wd4820 /wd4365) add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif() diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index c71e9c2a..6107de4c 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -399,12 +399,12 @@ // nullptr #if GLM_LANG & GLM_LANG_CXX0X_FLAG -# define GLM_HAS_NULLPTR 1 +# define GLM_USE_NULLPTR GLM_ENABLE #else -# define GLM_HAS_NULLPTR 0 +# define GLM_USE_NULLPTR GLM_DISABLE #endif -#if GLM_HAS_NULLPTR +#if GLM_USE_NULLPTR == GLM_ENABLE # define GLM_NULLPTR nullptr #else # define GLM_NULLPTR 0 @@ -433,12 +433,6 @@ # define GLM_CUDA_FUNC_DECL #endif -#if GLM_COMPILER & GLM_COMPILER_GCC -# define GLM_VAR_USED __attribute__ ((unused)) -#else -# define GLM_VAR_USED -#endif - #if defined(GLM_FORCE_INLINE) # if GLM_COMPILER & GLM_COMPILER_VC # define GLM_INLINE __forceinline @@ -518,49 +512,17 @@ #if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS)) # define GLM_DEPRECATED __declspec(deprecated) -# define GLM_ALIGN(x) __declspec(align(x)) -# define GLM_ALIGNED_STRUCT(x) struct __declspec(align(x)) # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name -# define GLM_RESTRICT_FUNC __declspec(restrict) -# define GLM_RESTRICT __restrict -# if GLM_COMPILER >= GLM_COMPILER_VC12 -# define GLM_VECTOR_CALL __vectorcall -# else -# define GLM_VECTOR_CALL -# endif #elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL) # define GLM_DEPRECATED __attribute__((__deprecated__)) -# define GLM_ALIGN(x) __attribute__((aligned(x))) -# define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x))) # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment))) -# define GLM_RESTRICT_FUNC __restrict__ -# define GLM_RESTRICT __restrict__ -# if GLM_COMPILER & GLM_COMPILER_CLANG -# if GLM_COMPILER >= GLM_COMPILER_CLANG37 -# define GLM_VECTOR_CALL __vectorcall -# else -# define GLM_VECTOR_CALL -# endif -# else -# define GLM_VECTOR_CALL -# endif #elif GLM_COMPILER & GLM_COMPILER_CUDA # define GLM_DEPRECATED -# define GLM_ALIGN(x) __align__(x) -# define GLM_ALIGNED_STRUCT(x) struct __align__(x) # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x) -# define GLM_RESTRICT_FUNC __restrict__ -# define GLM_RESTRICT __restrict__ -# define GLM_VECTOR_CALL #else # define GLM_DEPRECATED -# define GLM_ALIGN -# define GLM_ALIGNED_STRUCT(x) struct # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name -# define GLM_RESTRICT_FUNC -# define GLM_RESTRICT -# define GLM_VECTOR_CALL -#endif//GLM_COMPILER +#endif /////////////////////////////////////////////////////////////////////////////////// @@ -606,13 +568,6 @@ namespace glm # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) #endif -/////////////////////////////////////////////////////////////////////////////////// -// Check inclusions of different versions of GLM - -#elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION)) -# error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error." -#elif GLM_SETUP_INCLUDED == GLM_VERSION - /////////////////////////////////////////////////////////////////////////////////// // Configure the use of defaulted initialized types @@ -665,6 +620,13 @@ namespace glm # define GLM_USE_ANONYMOUS_STRUCT GLM_DISABLE #endif +/////////////////////////////////////////////////////////////////////////////////// +// Check inclusions of different versions of GLM + +#elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION)) +# error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error." +#elif GLM_SETUP_INCLUDED == GLM_VERSION + /////////////////////////////////////////////////////////////////////////////////// // Messages diff --git a/test/bug/bug_ms_vec_static.cpp b/test/bug/bug_ms_vec_static.cpp index 662321a0..3b433716 100644 --- a/test/bug/bug_ms_vec_static.cpp +++ b/test/bug/bug_ms_vec_static.cpp @@ -1,6 +1,6 @@ #include -#if GLM_HAS_ANONYMOUS_STRUCT +#if GLM_USE_ANONYMOUS_STRUCT == GLM_ENABLE struct vec2; struct _swizzle From 7c9c8cbd6fc9fef1022f3e2e190cc6bdbead4903 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 Jul 2018 20:13:40 +0200 Subject: [PATCH 07/14] Fixed clang build --- glm/detail/setup.hpp | 3 ++- glm/ext.hpp | 2 +- glm/gtc/quaternion.inl | 2 +- test/gtx/gtx_io.cpp | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 6107de4c..3b012912 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -483,7 +483,8 @@ #endif /////////////////////////////////////////////////////////////////////////////////// -// Clip control +// Clip control, define GLM_FORCE_DEPTH_ZERO_TO_ONE before including GLM +// to use a clip space between 0 to 1. #define GLM_DEPTH_ZERO_TO_ONE 0x00000001 #define GLM_DEPTH_NEGATIVE_ONE_TO_ONE 0x00000002 diff --git a/glm/ext.hpp b/glm/ext.hpp index 5f1ae318..c91e8e64 100644 --- a/glm/ext.hpp +++ b/glm/ext.hpp @@ -36,7 +36,7 @@ #include "./gtc/type_ptr.hpp" #include "./gtc/ulp.hpp" #include "./gtc/vec1.hpp" -#if GLM_HAS_ANONYMOUS_STRUCT +#if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE # include "./gtc/type_aligned.hpp" #endif diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 173a71d3..1b1f4398 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -799,7 +799,7 @@ namespace detail } }//namespace glm -#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT) +#if GLM_USE_SIMD == GLM_ENABLE # include "quaternion_simd.inl" #endif diff --git a/test/gtx/gtx_io.cpp b/test/gtx/gtx_io.cpp index a1b5efa9..ad0b49b3 100644 --- a/test/gtx/gtx_io.cpp +++ b/test/gtx/gtx_io.cpp @@ -20,7 +20,7 @@ namespace case glm::highp: os << "uhi"; break; case glm::mediump: os << "umd"; break; case glm::lowp: os << "ulo"; break; -# if GLM_HAS_ANONYMOUS_STRUCT +# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE case glm::aligned_highp: os << "ahi"; break; case glm::aligned_mediump: os << "amd"; break; case glm::aligned_lowp: os << "alo"; break; From b0d585dc1852e3dfb5616c58c66994df9171e11f Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 Jul 2018 20:14:48 +0200 Subject: [PATCH 08/14] Clean up --- glm/ext.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/glm/ext.hpp b/glm/ext.hpp index c91e8e64..ff02c784 100644 --- a/glm/ext.hpp +++ b/glm/ext.hpp @@ -31,7 +31,6 @@ #include "./gtc/random.hpp" #include "./gtc/reciprocal.hpp" #include "./gtc/round.hpp" -//#include "./gtc/type_aligned.hpp" #include "./gtc/type_precision.hpp" #include "./gtc/type_ptr.hpp" #include "./gtc/ulp.hpp" From 57b03c92ae05a65460b3c011688abad4d3e72b42 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 Jul 2018 20:25:38 +0200 Subject: [PATCH 09/14] Added force tests --- test/core/CMakeLists.txt | 4 ++++ test/core/core_force_aligned_gentypes.cpp | 12 ++++++++++++ test/core/core_force_ctor_init.cpp | 12 ++++++++++++ test/core/core_force_explicit_ctor.cpp | 12 ++++++++++++ test/core/core_force_inline.cpp | 12 ++++++++++++ test/core/core_force_unrestricted_gentype.cpp | 2 +- 6 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 test/core/core_force_aligned_gentypes.cpp create mode 100644 test/core/core_force_ctor_init.cpp create mode 100644 test/core/core_force_explicit_ctor.cpp create mode 100644 test/core/core_force_inline.cpp diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt index eace0aba..13477a97 100644 --- a/test/core/CMakeLists.txt +++ b/test/core/CMakeLists.txt @@ -1,3 +1,7 @@ +glmCreateTestGTC(core_force_aligned_gentypes) +glmCreateTestGTC(core_force_ctor_init) +glmCreateTestGTC(core_force_explicit_ctor) +glmCreateTestGTC(core_force_inline) glmCreateTestGTC(core_force_pure) glmCreateTestGTC(core_force_unrestricted_gentype) glmCreateTestGTC(core_type_aligned) diff --git a/test/core/core_force_aligned_gentypes.cpp b/test/core/core_force_aligned_gentypes.cpp new file mode 100644 index 00000000..068d7efa --- /dev/null +++ b/test/core/core_force_aligned_gentypes.cpp @@ -0,0 +1,12 @@ +#define GLM_FORCE_ALIGNED_GENTYPES + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/test/core/core_force_ctor_init.cpp b/test/core/core_force_ctor_init.cpp new file mode 100644 index 00000000..ec47c730 --- /dev/null +++ b/test/core/core_force_ctor_init.cpp @@ -0,0 +1,12 @@ +#define GLM_FORCE_CTOR_INIT + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/test/core/core_force_explicit_ctor.cpp b/test/core/core_force_explicit_ctor.cpp new file mode 100644 index 00000000..cec2fe98 --- /dev/null +++ b/test/core/core_force_explicit_ctor.cpp @@ -0,0 +1,12 @@ +#define GLM_FORCE_EXPLICIT_CTOR + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/test/core/core_force_inline.cpp b/test/core/core_force_inline.cpp new file mode 100644 index 00000000..cd23fd98 --- /dev/null +++ b/test/core/core_force_inline.cpp @@ -0,0 +1,12 @@ +#define GLM_FORCE_INLINE + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/test/core/core_force_unrestricted_gentype.cpp b/test/core/core_force_unrestricted_gentype.cpp index f198fa33..21d6e520 100644 --- a/test/core/core_force_unrestricted_gentype.cpp +++ b/test/core/core_force_unrestricted_gentype.cpp @@ -1,7 +1,7 @@ #define GLM_FORCE_UNRESTRICTED_GENTYPE -#define GLM_FORCE_SWIZZLE #include +#include int main() { From 988858145c868d067b45457fcfd5c593a6f3a6aa Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 Jul 2018 20:42:38 +0200 Subject: [PATCH 10/14] Added intersectLineTriangle tests --- glm/gtx/intersect.inl | 27 -------------------------- test/core/core_force_explicit_ctor.cpp | 5 +++++ test/gtx/gtx_intersect.cpp | 20 +++++++++++++++++++ 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/glm/gtx/intersect.inl b/glm/gtx/intersect.inl index 0ddb8ccf..8e5adcf2 100644 --- a/glm/gtx/intersect.inl +++ b/glm/gtx/intersect.inl @@ -91,33 +91,6 @@ namespace glm return true; } -/* - typename genType::value_type Epsilon = std::numeric_limits::epsilon(); - if(a < Epsilon && a > -Epsilon) - return false; - - typename genType::value_type f = typename genType::value_type(1.0f) / a; - - genType s = orig - v0; - baryPosition.x = f * glm::dot(s, p); - if(baryPosition.x < typename genType::value_type(0.0f)) - return false; - if(baryPosition.x > typename genType::value_type(1.0f)) - return false; - - genType q = glm::cross(s, e1); - baryPosition.y = f * glm::dot(dir, q); - if(baryPosition.y < typename genType::value_type(0.0f)) - return false; - if(baryPosition.y + baryPosition.x > typename genType::value_type(1.0f)) - return false; - - baryPosition.z = f * glm::dot(e2, q); - - return baryPosition.z >= typename genType::value_type(0.0f); - } -*/ - template GLM_FUNC_QUALIFIER bool intersectLineTriangle ( diff --git a/test/core/core_force_explicit_ctor.cpp b/test/core/core_force_explicit_ctor.cpp index cec2fe98..7af5b79f 100644 --- a/test/core/core_force_explicit_ctor.cpp +++ b/test/core/core_force_explicit_ctor.cpp @@ -7,6 +7,11 @@ int main() { int Error = 0; + glm::ivec4 B(1); + Error += B == glm::ivec4(1) ? 0 : 1; + + //glm::vec4 A = B; + return Error; } diff --git a/test/gtx/gtx_intersect.cpp b/test/gtx/gtx_intersect.cpp index a637dee8..7c6e74e5 100644 --- a/test/gtx/gtx_intersect.cpp +++ b/test/gtx/gtx_intersect.cpp @@ -24,11 +24,31 @@ int test_intersectRayTriangle() return Error; } +int test_intersectLineTriangle() +{ + int Error = 0; + + glm::vec3 const Orig(0, 0, 2); + glm::vec3 const Dir(0, 0, -1); + glm::vec3 const Vert0(0, 0, 0); + glm::vec3 const Vert1(-1, -1, 0); + glm::vec3 const Vert2(1, -1, 0); + glm::vec3 Position(2.0f, 0.0f, 0.0f); + + bool const Result = glm::intersectLineTriangle(Orig, Dir, Vert0, Vert1, Vert2, Position); + + Error += glm::all(glm::epsilonEqual(Position, glm::vec3(0), std::numeric_limits::epsilon())) ? 0 : 1; + Error += Result ? 0 : 1; + + return Error; +} + int main() { int Error = 0; Error += test_intersectRayTriangle(); + Error += test_intersectLineTriangle(); return Error; } From 0e11546a3dff03ddd1fe5bac4e2be53cf41d885f Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 Jul 2018 20:44:11 +0200 Subject: [PATCH 11/14] Removed unused messages --- glm/glm.hpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/glm/glm.hpp b/glm/glm.hpp index 194415f5..731e97e0 100644 --- a/glm/glm.hpp +++ b/glm/glm.hpp @@ -98,11 +98,6 @@ #include #include "fwd.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_CORE_INCLUDED_DISPLAYED) -# define GLM_MESSAGE_CORE_INCLUDED_DISPLAYED -# pragma message("GLM: Core library included") -#endif//GLM_MESSAGES - #include "vec2.hpp" #include "vec3.hpp" #include "vec4.hpp" From 0b39a770575fb0ee8d84d122bfff6df84ba0540a Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 Jul 2018 20:53:38 +0200 Subject: [PATCH 12/14] Fixed build errors --- glm/detail/func_exponential_simd.inl | 2 ++ glm/detail/func_matrix_simd.inl | 2 ++ glm/detail/qualifier.hpp | 4 ++-- glm/detail/type_vec4_simd.inl | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/glm/detail/func_exponential_simd.inl b/glm/detail/func_exponential_simd.inl index 4b2ef455..a9adea22 100644 --- a/glm/detail/func_exponential_simd.inl +++ b/glm/detail/func_exponential_simd.inl @@ -19,6 +19,7 @@ namespace detail } }; +# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE template<> struct compute_sqrt<4, float, aligned_lowp, true> { @@ -29,6 +30,7 @@ namespace detail return Result; } }; +# endif }//namespace detail }//namespace glm diff --git a/glm/detail/func_matrix_simd.inl b/glm/detail/func_matrix_simd.inl index b96c0282..9478ce52 100644 --- a/glm/detail/func_matrix_simd.inl +++ b/glm/detail/func_matrix_simd.inl @@ -61,6 +61,7 @@ namespace detail }; }//namespace detail +# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE template<> GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_lowp> outerProduct<4, 4, float, aligned_lowp>(vec<4, float, aligned_lowp> const& c, vec<4, float, aligned_lowp> const& r) { @@ -90,6 +91,7 @@ namespace detail std::memcpy(&Result[0], &NativeResult[0], sizeof(Result)); return Result; } +# endif }//namespace glm #endif diff --git a/glm/detail/qualifier.hpp b/glm/detail/qualifier.hpp index 2437fc06..9765fb2f 100644 --- a/glm/detail/qualifier.hpp +++ b/glm/detail/qualifier.hpp @@ -15,7 +15,7 @@ namespace glm packed_mediump, ///< Typed data is tightly packed in memory and operations are executed with medium precision in term of ULPs for higher performance packed_lowp, ///< Typed data is tightly packed in memory and operations are executed with low precision in term of ULPs to maximize performance -# if (GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE) +# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE aligned_highp, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs aligned_mediump, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs for higher performance aligned_lowp, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance @@ -27,7 +27,7 @@ namespace glm lowp = packed_lowp, ///< By default lowp qualifier is also packed packed = packed_highp, ///< By default packed qualifier is also high precision -# if (GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE) && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) +# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) defaultp = aligned_highp # else defaultp = highp diff --git a/glm/detail/type_vec4_simd.inl b/glm/detail/type_vec4_simd.inl index db0eb3b2..618c895e 100644 --- a/glm/detail/type_vec4_simd.inl +++ b/glm/detail/type_vec4_simd.inl @@ -147,6 +147,7 @@ namespace detail }; # endif +# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE template<> struct compute_vec4_div { @@ -157,6 +158,7 @@ namespace detail return Result; } }; +# endif template struct compute_vec4_and @@ -343,6 +345,7 @@ namespace detail }; }//namespace detail +# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE template<> GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<4, float, aligned_lowp>::vec(float _s) : data(_mm_set1_ps(_s)) @@ -457,6 +460,7 @@ namespace detail GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<4, float, aligned_highp>::vec(int32 _x, int32 _y, int32 _z, int32 _w) : data(_mm_castsi128_ps(_mm_set_epi32(_w, _z, _y, _x))) {} +#endif// GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE }//namespace glm #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT From 75a711dffb18469ad5586b271b3e894aaa42bcba Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 Jul 2018 20:59:29 +0200 Subject: [PATCH 13/14] Fixed tests --- test/gtx/gtx_intersect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/gtx/gtx_intersect.cpp b/test/gtx/gtx_intersect.cpp index 7c6e74e5..5a575490 100644 --- a/test/gtx/gtx_intersect.cpp +++ b/test/gtx/gtx_intersect.cpp @@ -37,7 +37,7 @@ int test_intersectLineTriangle() bool const Result = glm::intersectLineTriangle(Orig, Dir, Vert0, Vert1, Vert2, Position); - Error += glm::all(glm::epsilonEqual(Position, glm::vec3(0), std::numeric_limits::epsilon())) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Position, glm::vec3(2.0f, 0.0f, 0.0f), std::numeric_limits::epsilon())) ? 0 : 1; Error += Result ? 0 : 1; return Error; From ea1fccae5ecbe5e6f8f2cdf6f61ee6f166427bd8 Mon Sep 17 00:00:00 2001 From: Groove Date: Tue, 24 Jul 2018 00:50:58 +0200 Subject: [PATCH 14/14] Fixed definision and declarion constexpr miss match --- glm/gtx/dual_quaternion.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index 58e00be5..4518df21 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -26,7 +26,7 @@ namespace glm # if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 tdualquat::tdualquat() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 tdualquat::tdualquat() # if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE : real(tquat()) , dual(tquat(0, 0, 0, 0))