From 88ee302567559364999d841a4cfa20f401f2c5f2 Mon Sep 17 00:00:00 2001 From: zhumeng1989 Date: Mon, 10 Jun 2013 22:23:22 +0800 Subject: [PATCH 01/21] Minor fix 1. type_vec4.hpp __declspec(align(16)) produces a compiler error on VS2012: func_common.inl(634): error C2719: 'a': formal parameter with __declspec(align('16')) won't be aligned core_func_common.cpp(310) : see reference to function template instantiation 'glm::detail::tvec4 glm::mix(const glm::detail::tvec4 &,const glm::detail::tvec4 &,glm::detail::tvec4)' being compiled with [ T=float, P=highp ] and a warning on CygWin using gcc 4.7.2: type_vec4.hpp:40:31: warning: 'align' attribute directive ignored [-Wattributes] 2. gtx_bit.cpp glm::uint32 x_max = 1 << 13; glm::uint32 y_max = 1 << 12; result out of memory on my machine. --- glm/core/type_vec4.hpp | 2 +- test/gtx/gtx_bit.cpp | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index e773c8d0..9deca8a4 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -37,7 +37,7 @@ namespace glm{ namespace detail { template - struct __declspec(align(16)) tvec4 + struct tvec4 { enum ctor{_null}; diff --git a/test/gtx/gtx_bit.cpp b/test/gtx/gtx_bit.cpp index a6bcffd1..9e826e21 100644 --- a/test/gtx/gtx_bit.cpp +++ b/test/gtx/gtx_bit.cpp @@ -361,8 +361,8 @@ namespace bitfieldInterleave int test() { - glm::uint32 x_max = 1 << 13; - glm::uint32 y_max = 1 << 12; + glm::uint32 x_max = 1 << 11; + glm::uint32 y_max = 1 << 10; // ALU std::vector Data(x_max * y_max); @@ -493,17 +493,14 @@ namespace bitfieldInterleave # if(GLM_ARCH != GLM_ARCH_PURE) { // SIMD - glm::int32 simd_x_max = 1 << 13; - glm::int32 simd_y_max = 1 << 12; - std::vector<__m128i> SimdData(x_max * y_max); std::vector<__m128i> SimdParam(x_max * y_max); for(int i = 0; i < SimdParam.size(); ++i) - SimdParam[i] = _mm_set_epi32(i % simd_x_max, 0, i / simd_y_max, 0); + SimdParam[i] = _mm_set_epi32(i % x_max, 0, i / y_max, 0); std::clock_t LastTime = std::clock(); - for(std::size_t i = 0; i < Data.size(); ++i) + for(std::size_t i = 0; i < SimdData.size(); ++i) SimdData[i] = glm::detail::_mm_bit_interleave_si128(SimdParam[i]); std::clock_t Time = std::clock() - LastTime; From 58dc29a8602e60589fdf0609dabe1964251c56ad Mon Sep 17 00:00:00 2001 From: tszirr Date: Fri, 14 Jun 2013 16:38:58 +0200 Subject: [PATCH 02/21] fix: subscript swizzles in cuda device code --- glm/core/_swizzle.hpp | 62 +++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/glm/core/_swizzle.hpp b/glm/core/_swizzle.hpp index 5a522fef..c6af9a4e 100644 --- a/glm/core/_swizzle.hpp +++ b/glm/core/_swizzle.hpp @@ -60,8 +60,8 @@ namespace detail typedef T value_type; protected: - value_type& elem (size_t i) { return (reinterpret_cast(_buffer))[i]; } - const value_type& elem (size_t i) const { return (reinterpret_cast(_buffer))[i]; } + GLM_FUNC_QUALIFIER value_type& elem (size_t i) { return (reinterpret_cast(_buffer))[i]; } + GLM_FUNC_QUALIFIER const value_type& elem (size_t i) const { return (reinterpret_cast(_buffer))[i]; } // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. // The size 1 buffer is assumed to aligned to the actual members so that the @@ -77,19 +77,19 @@ namespace detail template struct _swizzle_base1 : public _swizzle_base0 { - V operator ()() const { return V(this->elem(E0), this->elem(E1)); } + GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1)); } }; template struct _swizzle_base1 : public _swizzle_base0 { - V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); } + GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); } }; template struct _swizzle_base1 : public _swizzle_base0 { - V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } + GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } }; // Internal class for implementing swizzle operators @@ -110,14 +110,14 @@ namespace detail typedef VecType vec_type; typedef ValueType value_type; - _swizzle_base2& operator= (const ValueType& t) + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const ValueType& t) { for (int i = 0; i < N; ++i) (*this)[i] = t; return *this; } - _swizzle_base2& operator= (const VecType& that) + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const VecType& that) { struct op { void operator() (value_type& e, value_type& t) { e = t; } @@ -126,7 +126,7 @@ namespace detail return *this; } - void operator -= (const VecType& that) + GLM_FUNC_QUALIFIER void operator -= (const VecType& that) { struct op { void operator() (value_type& e, value_type& t) { e -= t; } @@ -134,7 +134,7 @@ namespace detail _apply_op(that, op()); } - void operator += (const VecType& that) + GLM_FUNC_QUALIFIER void operator += (const VecType& that) { struct op { void operator() (value_type& e, value_type& t) { e += t; } @@ -142,7 +142,7 @@ namespace detail _apply_op(that, op()); } - void operator *= (const VecType& that) + GLM_FUNC_QUALIFIER void operator *= (const VecType& that) { struct op { void operator() (value_type& e, value_type& t) { e *= t; } @@ -150,7 +150,7 @@ namespace detail _apply_op(that, op()); } - void operator /= (const VecType& that) + GLM_FUNC_QUALIFIER void operator /= (const VecType& that) { struct op { void operator() (value_type& e, value_type& t) { e /= t; } @@ -158,19 +158,19 @@ namespace detail _apply_op(that, op()); } - value_type& operator[] (size_t i) + GLM_FUNC_QUALIFIER value_type& operator[] (size_t i) { static const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } - value_type operator[] (size_t i) const + GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const { static const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } protected: template - void _apply_op(const VecType& that, T op) + GLM_FUNC_QUALIFIER void _apply_op(const VecType& that, T op) { // Make a copy of the data in this == &that. // The copier should optimize out the copy in cases where the function is @@ -191,9 +191,9 @@ namespace detail typedef ValueType value_type; struct Stub {}; - _swizzle_base2& operator= (Stub const &) { return *this; } + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const &) { return *this; } - value_type operator[] (size_t i) const + GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const { static const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); @@ -207,7 +207,7 @@ namespace detail using base_type::operator=; - operator VecType () const { return (*this)(); } + GLM_FUNC_QUALIFIER operator VecType () const { return (*this)(); } }; // @@ -223,17 +223,17 @@ namespace detail // #define _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ _GLM_SWIZZLE_TEMPLATE2 \ - V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ { \ return a() OPERAND b(); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \ { \ return a() OPERAND b; \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return a OPERAND b(); \ } @@ -243,12 +243,12 @@ namespace detail // #define _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ _GLM_SWIZZLE_TEMPLATE1 \ - V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \ { \ return a() OPERAND b; \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return a OPERAND b(); \ } @@ -258,7 +258,7 @@ namespace detail // #define _GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \ { \ return FUNCTION(a()); \ } @@ -268,22 +268,22 @@ namespace detail // #define _GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \ _GLM_SWIZZLE_TEMPLATE2 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ { \ return FUNCTION(a(), b()); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return FUNCTION(a(), b()); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \ { \ return FUNCTION(a(), b); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return FUNCTION(a, b()); \ } @@ -293,22 +293,22 @@ namespace detail // #define _GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \ _GLM_SWIZZLE_TEMPLATE2 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \ { \ return FUNCTION(a(), b(), c); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ { \ return FUNCTION(a(), b(), c); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ { \ return FUNCTION(a(), b, c); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ { \ return FUNCTION(a, b(), c); \ } From b016594ac3a39636ddae30035f99a25f2a8d0f4a Mon Sep 17 00:00:00 2001 From: tszirr Date: Mon, 17 Jun 2013 10:49:02 +0200 Subject: [PATCH 03/21] fix: function-local static arrays unsupported in cuda device code --- glm/core/_swizzle.hpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/glm/core/_swizzle.hpp b/glm/core/_swizzle.hpp index c6af9a4e..8edadd70 100644 --- a/glm/core/_swizzle.hpp +++ b/glm/core/_swizzle.hpp @@ -160,12 +160,18 @@ namespace detail GLM_FUNC_QUALIFIER value_type& operator[] (size_t i) { - static const int offset_dst[4] = { E0, E1, E2, E3 }; +#ifndef __CUDA_ARCH__ + static +#endif + const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const { - static const int offset_dst[4] = { E0, E1, E2, E3 }; +#ifndef __CUDA_ARCH__ + static +#endif + const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } protected: @@ -195,7 +201,10 @@ namespace detail GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const { - static const int offset_dst[4] = { E0, E1, E2, E3 }; +#ifndef __CUDA_ARCH__ + static +#endif + const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } }; From 5a48614f57cff4318b922efa6e6ef40863c33b39 Mon Sep 17 00:00:00 2001 From: tszirr Date: Fri, 21 Jun 2013 17:17:34 +0200 Subject: [PATCH 04/21] fix: component declaration order -> debug display order! --- glm/core/type_vec2.hpp | 8 ++++---- glm/core/type_vec3.hpp | 8 ++++---- glm/core/type_vec4.hpp | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp index 97b9fa8f..3f8083d8 100644 --- a/glm/core/type_vec2.hpp +++ b/glm/core/type_vec2.hpp @@ -62,6 +62,10 @@ namespace detail # if(GLM_COMPONENT == GLM_COMPONENT_CXX11) union { + struct{value_type x, y;}; + struct{value_type r, g;}; + struct{value_type s, t;}; + # if(defined(GLM_SWIZZLE)) _GLM_SWIZZLE2_2_MEMBERS(value_type, glm::detail::tvec2, x, y) _GLM_SWIZZLE2_2_MEMBERS(value_type, glm::detail::tvec2, r, g) @@ -73,10 +77,6 @@ namespace detail _GLM_SWIZZLE2_4_MEMBERS(value_type, glm::detail::tvec4, r, g) _GLM_SWIZZLE2_4_MEMBERS(value_type, glm::detail::tvec4, s, t) # endif//(defined(GLM_SWIZZLE)) - - struct{value_type r, g;}; - struct{value_type s, t;}; - struct{value_type x, y;}; }; # elif(GLM_COMPONENT == GLM_COMPONENT_CXX98) union {value_type x, r, s;}; diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp index 26c9a219..7165fa5d 100644 --- a/glm/core/type_vec3.hpp +++ b/glm/core/type_vec3.hpp @@ -62,6 +62,10 @@ namespace detail # if(GLM_COMPONENT == GLM_COMPONENT_CXX11) union { + struct{value_type x, y, z;}; + struct{value_type r, g, b;}; + struct{value_type s, t, p;}; + # if(defined(GLM_SWIZZLE)) _GLM_SWIZZLE3_2_MEMBERS(value_type, glm::detail::tvec2, x, y, z) _GLM_SWIZZLE3_2_MEMBERS(value_type, glm::detail::tvec2, r, g, b) @@ -73,10 +77,6 @@ namespace detail _GLM_SWIZZLE3_4_MEMBERS(value_type, glm::detail::tvec4, r, g, b) _GLM_SWIZZLE3_4_MEMBERS(value_type, glm::detail::tvec4, s, t, p) # endif//(defined(GLM_SWIZZLE)) - - struct{value_type r, g, b;}; - struct{value_type s, t, p;}; - struct{value_type x, y, z;}; }; # elif(GLM_COMPONENT == GLM_COMPONENT_CXX98) union {value_type x, r, s;}; diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index d7d092a2..c8860e22 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -62,6 +62,10 @@ namespace detail # if(GLM_COMPONENT == GLM_COMPONENT_CXX11) union { + struct{value_type x, y, z, w;}; + struct{value_type r, g, b, a;}; + struct{value_type s, t, p, q;}; + # if(defined(GLM_SWIZZLE)) _GLM_SWIZZLE4_2_MEMBERS(value_type, glm::detail::tvec2, x, y, z, w) _GLM_SWIZZLE4_2_MEMBERS(value_type, glm::detail::tvec2, r, g, b, a) @@ -73,10 +77,6 @@ namespace detail _GLM_SWIZZLE4_4_MEMBERS(value_type, glm::detail::tvec4, r, g, b, a) _GLM_SWIZZLE4_4_MEMBERS(value_type, glm::detail::tvec4, s, t, p, q) # endif//(defined(GLM_SWIZZLE)) - - struct{value_type r, g, b, a;}; - struct{value_type s, t, p, q;}; - struct{value_type x, y, z, w;}; }; # elif(GLM_COMPONENT == GLM_COMPONENT_CXX98) union {value_type x, r, s;}; From 2d88860244eb6a92f56d58e27b6d741c986035a1 Mon Sep 17 00:00:00 2001 From: tszirr Date: Mon, 24 Jun 2013 11:45:19 +0200 Subject: [PATCH 05/21] fix: no implicit vector copy --- glm/core/type_vec1.hpp | 4 ++++ glm/core/type_vec1.inl | 4 ++++ glm/core/type_vec2.hpp | 4 ++++ glm/core/type_vec2.inl | 4 ++++ glm/core/type_vec3.hpp | 4 ++++ glm/core/type_vec3.inl | 4 ++++ glm/core/type_vec4.hpp | 4 ++++ glm/core/type_vec4.inl | 4 ++++ 8 files changed, 32 insertions(+) diff --git a/glm/core/type_vec1.hpp b/glm/core/type_vec1.hpp index 395cc789..0bc4d878 100644 --- a/glm/core/type_vec1.hpp +++ b/glm/core/type_vec1.hpp @@ -78,7 +78,9 @@ namespace detail // Implicit basic constructors GLM_FUNC_DECL tvec1(); +#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec1(tvec1 const & v); +#endif ////////////////////////////////////// // Explicit basic constructors @@ -116,7 +118,9 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators +#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec1 & operator= (tvec1 const & v); +#endif template GLM_FUNC_DECL tvec1 & operator= (tvec1 const & v); diff --git a/glm/core/type_vec1.inl b/glm/core/type_vec1.inl index 6b12e03d..4fff65e3 100644 --- a/glm/core/type_vec1.inl +++ b/glm/core/type_vec1.inl @@ -73,6 +73,7 @@ namespace detail ) {} +#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec1::tvec1 ( @@ -80,6 +81,7 @@ namespace detail ) : x(v.x) {} +#endif ////////////////////////////////////// // Explicit basic constructors @@ -148,6 +150,7 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators +#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator= ( @@ -157,6 +160,7 @@ namespace detail this->x = v.x; return *this; } +#endif template template diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp index 97b9fa8f..70572d97 100644 --- a/glm/core/type_vec2.hpp +++ b/glm/core/type_vec2.hpp @@ -107,7 +107,9 @@ namespace detail // Implicit basic constructors GLM_FUNC_DECL tvec2(); +#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec2(tvec2 const & v); +#endif ////////////////////////////////////// // Explicit basic constructors @@ -160,7 +162,9 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators +#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec2 & operator= (tvec2 const & v); +#endif template GLM_FUNC_DECL tvec2 & operator= (tvec2 const & v); diff --git a/glm/core/type_vec2.inl b/glm/core/type_vec2.inl index fbad911b..c7d53f6e 100644 --- a/glm/core/type_vec2.inl +++ b/glm/core/type_vec2.inl @@ -76,6 +76,7 @@ namespace detail ) {} +#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec2::tvec2 ( @@ -84,6 +85,7 @@ namespace detail x(v.x), y(v.y) {} +#endif ////////////////////////////////////// // Explicit basic constructors @@ -179,6 +181,7 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators +#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec2 & tvec2::operator= ( @@ -189,6 +192,7 @@ namespace detail this->y = v.y; return *this; } +#endif template template diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp index 26c9a219..3efe71d5 100644 --- a/glm/core/type_vec3.hpp +++ b/glm/core/type_vec3.hpp @@ -108,7 +108,9 @@ namespace detail // Implicit basic constructors GLM_FUNC_DECL tvec3(); +#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec3(tvec3 const & v); +#endif ////////////////////////////////////// // Explicit basic constructors @@ -184,7 +186,9 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators +#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec3 & operator= (tvec3 const & v); +#endif template GLM_FUNC_DECL tvec3 & operator= (tvec3 const & v); diff --git a/glm/core/type_vec3.inl b/glm/core/type_vec3.inl index 3bcf1c8a..0f774b5b 100644 --- a/glm/core/type_vec3.inl +++ b/glm/core/type_vec3.inl @@ -77,6 +77,7 @@ namespace detail ) {} +#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec3::tvec3 ( @@ -86,6 +87,7 @@ namespace detail y(v.y), z(v.z) {} +#endif ////////////////////////////////////// // Explicit basic constructors @@ -228,6 +230,7 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators +#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec3& tvec3::operator= ( @@ -239,6 +242,7 @@ namespace detail this->z = v.z; return *this; } +#endif template template diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index d7d092a2..98bd732a 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -109,7 +109,9 @@ namespace detail // Implicit basic constructors GLM_FUNC_DECL tvec4(); +#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec4(type const & v); +#endif ////////////////////////////////////// // Explicit basic constructors @@ -239,7 +241,9 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators +#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec4 & operator= (tvec4 const & v); +#endif template GLM_FUNC_DECL tvec4 & operator= (tvec4 const & v); diff --git a/glm/core/type_vec4.inl b/glm/core/type_vec4.inl index 744d2d0f..a636a6e8 100644 --- a/glm/core/type_vec4.inl +++ b/glm/core/type_vec4.inl @@ -78,6 +78,7 @@ namespace detail ) {} +#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec4::tvec4 ( @@ -88,6 +89,7 @@ namespace detail z(v.z), w(v.w) {} +#endif ////////////////////////////////////// // Explicit basic constructors @@ -367,6 +369,7 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators +#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec4 & tvec4::operator= ( @@ -379,6 +382,7 @@ namespace detail this->w = v.w; return *this; } +#endif template template From 861d6d19331a6224efc3af5e709e23eddaf4259e Mon Sep 17 00:00:00 2001 From: tszirr Date: Fri, 12 Jul 2013 15:29:48 +0200 Subject: [PATCH 06/21] fix: swizzled operations in cuda code --- glm/core/_swizzle.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/glm/core/_swizzle.hpp b/glm/core/_swizzle.hpp index 8edadd70..dc069443 100644 --- a/glm/core/_swizzle.hpp +++ b/glm/core/_swizzle.hpp @@ -120,7 +120,7 @@ namespace detail GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const VecType& that) { struct op { - void operator() (value_type& e, value_type& t) { e = t; } + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e = t; } }; _apply_op(that, op()); return *this; @@ -129,7 +129,7 @@ namespace detail GLM_FUNC_QUALIFIER void operator -= (const VecType& that) { struct op { - void operator() (value_type& e, value_type& t) { e -= t; } + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e -= t; } }; _apply_op(that, op()); } @@ -137,7 +137,7 @@ namespace detail GLM_FUNC_QUALIFIER void operator += (const VecType& that) { struct op { - void operator() (value_type& e, value_type& t) { e += t; } + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e += t; } }; _apply_op(that, op()); } @@ -145,7 +145,7 @@ namespace detail GLM_FUNC_QUALIFIER void operator *= (const VecType& that) { struct op { - void operator() (value_type& e, value_type& t) { e *= t; } + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e *= t; } }; _apply_op(that, op()); } @@ -153,7 +153,7 @@ namespace detail GLM_FUNC_QUALIFIER void operator /= (const VecType& that) { struct op { - void operator() (value_type& e, value_type& t) { e /= t; } + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e /= t; } }; _apply_op(that, op()); } From 968c892f92199c93c60b39f5c02a718e45964dbe Mon Sep 17 00:00:00 2001 From: tszirr Date: Fri, 12 Jul 2013 15:44:02 +0200 Subject: [PATCH 07/21] Revert "fix: no implicit vector copy" Reason: Wrong branch This reverts commit 2d88860244eb6a92f56d58e27b6d741c986035a1. --- glm/core/type_vec1.hpp | 4 ---- glm/core/type_vec1.inl | 4 ---- glm/core/type_vec2.hpp | 4 ---- glm/core/type_vec2.inl | 4 ---- glm/core/type_vec3.hpp | 4 ---- glm/core/type_vec3.inl | 4 ---- glm/core/type_vec4.hpp | 4 ---- glm/core/type_vec4.inl | 4 ---- 8 files changed, 32 deletions(-) diff --git a/glm/core/type_vec1.hpp b/glm/core/type_vec1.hpp index 0bc4d878..395cc789 100644 --- a/glm/core/type_vec1.hpp +++ b/glm/core/type_vec1.hpp @@ -78,9 +78,7 @@ namespace detail // Implicit basic constructors GLM_FUNC_DECL tvec1(); -#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec1(tvec1 const & v); -#endif ////////////////////////////////////// // Explicit basic constructors @@ -118,9 +116,7 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators -#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec1 & operator= (tvec1 const & v); -#endif template GLM_FUNC_DECL tvec1 & operator= (tvec1 const & v); diff --git a/glm/core/type_vec1.inl b/glm/core/type_vec1.inl index 4fff65e3..6b12e03d 100644 --- a/glm/core/type_vec1.inl +++ b/glm/core/type_vec1.inl @@ -73,7 +73,6 @@ namespace detail ) {} -#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec1::tvec1 ( @@ -81,7 +80,6 @@ namespace detail ) : x(v.x) {} -#endif ////////////////////////////////////// // Explicit basic constructors @@ -150,7 +148,6 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators -#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator= ( @@ -160,7 +157,6 @@ namespace detail this->x = v.x; return *this; } -#endif template template diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp index 61d4a952..3f8083d8 100644 --- a/glm/core/type_vec2.hpp +++ b/glm/core/type_vec2.hpp @@ -107,9 +107,7 @@ namespace detail // Implicit basic constructors GLM_FUNC_DECL tvec2(); -#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec2(tvec2 const & v); -#endif ////////////////////////////////////// // Explicit basic constructors @@ -162,9 +160,7 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators -#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec2 & operator= (tvec2 const & v); -#endif template GLM_FUNC_DECL tvec2 & operator= (tvec2 const & v); diff --git a/glm/core/type_vec2.inl b/glm/core/type_vec2.inl index c7d53f6e..fbad911b 100644 --- a/glm/core/type_vec2.inl +++ b/glm/core/type_vec2.inl @@ -76,7 +76,6 @@ namespace detail ) {} -#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec2::tvec2 ( @@ -85,7 +84,6 @@ namespace detail x(v.x), y(v.y) {} -#endif ////////////////////////////////////// // Explicit basic constructors @@ -181,7 +179,6 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators -#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec2 & tvec2::operator= ( @@ -192,7 +189,6 @@ namespace detail this->y = v.y; return *this; } -#endif template template diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp index 75640632..7165fa5d 100644 --- a/glm/core/type_vec3.hpp +++ b/glm/core/type_vec3.hpp @@ -108,9 +108,7 @@ namespace detail // Implicit basic constructors GLM_FUNC_DECL tvec3(); -#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec3(tvec3 const & v); -#endif ////////////////////////////////////// // Explicit basic constructors @@ -186,9 +184,7 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators -#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec3 & operator= (tvec3 const & v); -#endif template GLM_FUNC_DECL tvec3 & operator= (tvec3 const & v); diff --git a/glm/core/type_vec3.inl b/glm/core/type_vec3.inl index 0f774b5b..3bcf1c8a 100644 --- a/glm/core/type_vec3.inl +++ b/glm/core/type_vec3.inl @@ -77,7 +77,6 @@ namespace detail ) {} -#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec3::tvec3 ( @@ -87,7 +86,6 @@ namespace detail y(v.y), z(v.z) {} -#endif ////////////////////////////////////// // Explicit basic constructors @@ -230,7 +228,6 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators -#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec3& tvec3::operator= ( @@ -242,7 +239,6 @@ namespace detail this->z = v.z; return *this; } -#endif template template diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index 48c08188..c8860e22 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -109,9 +109,7 @@ namespace detail // Implicit basic constructors GLM_FUNC_DECL tvec4(); -#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec4(type const & v); -#endif ////////////////////////////////////// // Explicit basic constructors @@ -241,9 +239,7 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators -#ifndef GLM_NO_EXPLICIT_COPY GLM_FUNC_DECL tvec4 & operator= (tvec4 const & v); -#endif template GLM_FUNC_DECL tvec4 & operator= (tvec4 const & v); diff --git a/glm/core/type_vec4.inl b/glm/core/type_vec4.inl index a636a6e8..744d2d0f 100644 --- a/glm/core/type_vec4.inl +++ b/glm/core/type_vec4.inl @@ -78,7 +78,6 @@ namespace detail ) {} -#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec4::tvec4 ( @@ -89,7 +88,6 @@ namespace detail z(v.z), w(v.w) {} -#endif ////////////////////////////////////// // Explicit basic constructors @@ -369,7 +367,6 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators -#ifndef GLM_NO_EXPLICIT_COPY template GLM_FUNC_QUALIFIER tvec4 & tvec4::operator= ( @@ -382,7 +379,6 @@ namespace detail this->w = v.w; return *this; } -#endif template template From 4e43b388bdc2593f33e99d08fc00cd0a577e1720 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 14 Jul 2013 20:24:40 +0200 Subject: [PATCH 08/21] Updated release note for bug #97 --- readme.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 7c066843..75fbb57b 100644 --- a/readme.txt +++ b/readme.txt @@ -37,10 +37,11 @@ More informations in GLM manual: http://glm.g-truc.net/glm.pdf ================================================================================ -GLM 0.9.4.5: 2013-06-XX +GLM 0.9.4.5: 2013-07-XX -------------------------------------------------------------------------------- - Fixed inclusion of intrinsics in "pure" mode #92 - Fixed language detection on GCC when the C++0x mode isn't enabled #95 +- Fixed issue #97: register is deprecated in C++11 ================================================================================ GLM 0.9.4.4: 2013-05-29 From 2d983ed9cf80bac56ab05e8d651b50d7050e8279 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 15 Jul 2013 10:18:32 +0200 Subject: [PATCH 09/21] Added WINCE detection --- glm/core/setup.hpp | 7 ++++++- readme.txt | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index eb11115e..b7d1be06 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -50,6 +50,7 @@ #define GLM_PLATFORM_CHROME_NACL 0x00200000 #define GLM_PLATFORM_UNIX 0x00400000 #define GLM_PLATFORM_QNXNTO 0x00800000 +#define GLM_PLATFORM_WINCE 0x01000000 #ifdef GLM_FORCE_PLATFORM_UNKNOWN # define GLM_PLATFORM GLM_PLATFORM_UNKNOWN @@ -57,6 +58,8 @@ # define GLM_PLATFORM GLM_PLATFORM_QNXNTO #elif defined(__APPLE__) # define GLM_PLATFORM GLM_PLATFORM_APPLE +#elif defined(WINCE) +# define GLM_PLATFORM GLM_PLATFORM_WINCE #elif defined(_WIN32) # define GLM_PLATFORM GLM_PLATFORM_WINDOWS #elif defined(__native_client__) @@ -499,7 +502,9 @@ #elif(defined(GLM_FORCE_SSE2)) # define GLM_ARCH (GLM_ARCH_SSE2) #elif((GLM_COMPILER & GLM_COMPILER_VC) && (defined(_M_IX86) || defined(_M_X64))) -# if(defined(_M_CEE_PURE)) +# if(GLM_PLATFORM == GLM_PLATFORM_WINCE) +# define GLM_ARCH GLM_ARCH_PURE +# elif(defined(_M_CEE_PURE)) # define GLM_ARCH GLM_ARCH_PURE /* TODO: Explore auto detection of instruction set support # elif(defined(_M_IX86_FP)) diff --git a/readme.txt b/readme.txt index 75fbb57b..e028778e 100644 --- a/readme.txt +++ b/readme.txt @@ -42,6 +42,8 @@ GLM 0.9.4.5: 2013-07-XX - Fixed inclusion of intrinsics in "pure" mode #92 - Fixed language detection on GCC when the C++0x mode isn't enabled #95 - Fixed issue #97: register is deprecated in C++11 +- Fixed issue #96: CUDA issues +- Added Windows CE detection #92 ================================================================================ GLM 0.9.4.4: 2013-05-29 From b27ab93b194a82422dade253bcf1492299dd93e1 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 15 Jul 2013 10:33:00 +0200 Subject: [PATCH 10/21] Updated release date fo GLM 0.9.4.5 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index e028778e..7dfa1cf2 100644 --- a/readme.txt +++ b/readme.txt @@ -37,7 +37,7 @@ More informations in GLM manual: http://glm.g-truc.net/glm.pdf ================================================================================ -GLM 0.9.4.5: 2013-07-XX +GLM 0.9.4.5: 2013-07-15 -------------------------------------------------------------------------------- - Fixed inclusion of intrinsics in "pure" mode #92 - Fixed language detection on GCC when the C++0x mode isn't enabled #95 From e841c1dbe0d4e004f5b33b2ec63931bdcb57462b Mon Sep 17 00:00:00 2001 From: Jonathan Armond Date: Mon, 15 Jul 2013 12:06:54 +0100 Subject: [PATCH 11/21] Add missing non-const value_ptr for quat --- glm/gtc/type_ptr.inl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/glm/gtc/type_ptr.inl b/glm/gtc/type_ptr.inl index ac14036a..304f3e6e 100644 --- a/glm/gtc/type_ptr.inl +++ b/glm/gtc/type_ptr.inl @@ -284,6 +284,17 @@ namespace glm return &(mat[0].x); } + //! Return the constant address to the data of the input parameter. + /// @see gtc_type_ptr + template + GLM_FUNC_QUALIFIER T * value_ptr + ( + detail::tquat & q + ) + { + return &(q[0]); + } + //! Return the constant address to the data of the input parameter. /// @see gtc_type_ptr template From 1375a99b83d6b495b184886eb1f3f78279131591 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 12 Aug 2013 22:26:23 +0200 Subject: [PATCH 12/21] Added missing non-const value_ptr fort quat #99 --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 7c066843..14709287 100644 --- a/readme.txt +++ b/readme.txt @@ -41,6 +41,7 @@ GLM 0.9.4.5: 2013-06-XX -------------------------------------------------------------------------------- - Fixed inclusion of intrinsics in "pure" mode #92 - Fixed language detection on GCC when the C++0x mode isn't enabled #95 +- Added missing value_ptr for quaternions #99 ================================================================================ GLM 0.9.4.4: 2013-05-29 From 5b525ced24608719a10d922653d6aeb1190d23ba Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 12 Aug 2013 22:32:39 +0200 Subject: [PATCH 13/21] Back port fix for issue #99 --- glm/gtc/type_ptr.inl | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/glm/gtc/type_ptr.inl b/glm/gtc/type_ptr.inl index c0d1d877..6c5a1577 100644 --- a/glm/gtc/type_ptr.inl +++ b/glm/gtc/type_ptr.inl @@ -284,6 +284,14 @@ namespace glm return &(mat[0].x); } + //! Get the address of the matrix content. + /// @see gtc_type_ptr + template + GLM_FUNC_QUALIFIER T * value_ptr(detail::tmat4x3 & mat) + { + return &(mat[0].x); + } + //! Return the constant address to the data of the input parameter. /// @see gtc_type_ptr template @@ -295,12 +303,15 @@ namespace glm return &(q[0]); } - //! Get the address of the matrix content. + //! Return the constant address to the data of the input parameter. /// @see gtc_type_ptr template - GLM_FUNC_QUALIFIER T * value_ptr(detail::tmat4x3 & mat) + GLM_FUNC_QUALIFIER T * value_ptr + ( + detail::tquat & q + ) { - return &(mat[0].x); + return &(q[0]); } //! Build a vector from a pointer. From b592d9ff8353e5fef30ff9c29410ba9015c2d5b0 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 12 Aug 2013 23:05:29 +0200 Subject: [PATCH 14/21] Added WINCE detection #92 --- glm/core/setup.hpp | 3 +++ readme.txt | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index eb11115e..854e2ebb 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -50,6 +50,7 @@ #define GLM_PLATFORM_CHROME_NACL 0x00200000 #define GLM_PLATFORM_UNIX 0x00400000 #define GLM_PLATFORM_QNXNTO 0x00800000 +#define GLM_PLATFORM_WINCE 0x01000000 #ifdef GLM_FORCE_PLATFORM_UNKNOWN # define GLM_PLATFORM GLM_PLATFORM_UNKNOWN @@ -57,6 +58,8 @@ # define GLM_PLATFORM GLM_PLATFORM_QNXNTO #elif defined(__APPLE__) # define GLM_PLATFORM GLM_PLATFORM_APPLE +#elif defined(WINCE) +# define GLM_PLATFORM GLM_PLATFORM_WINCE #elif defined(_WIN32) # define GLM_PLATFORM GLM_PLATFORM_WINDOWS #elif defined(__native_client__) diff --git a/readme.txt b/readme.txt index 14709287..62d31cb6 100644 --- a/readme.txt +++ b/readme.txt @@ -37,11 +37,12 @@ More informations in GLM manual: http://glm.g-truc.net/glm.pdf ================================================================================ -GLM 0.9.4.5: 2013-06-XX +GLM 0.9.4.5: 2013-08-13 -------------------------------------------------------------------------------- - Fixed inclusion of intrinsics in "pure" mode #92 - Fixed language detection on GCC when the C++0x mode isn't enabled #95 - Added missing value_ptr for quaternions #99 +- Added WINCE detection #92 ================================================================================ GLM 0.9.4.4: 2013-05-29 From 37ae8da67c8f6810fc40d85a11dc452b3ef2218f Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 12 Aug 2013 23:18:28 +0200 Subject: [PATCH 15/21] Updated readme for release --- readme.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 62d31cb6..6fcb28aa 100644 --- a/readme.txt +++ b/readme.txt @@ -37,9 +37,10 @@ More informations in GLM manual: http://glm.g-truc.net/glm.pdf ================================================================================ -GLM 0.9.4.5: 2013-08-13 +GLM 0.9.4.5: 2013-08-12 -------------------------------------------------------------------------------- -- Fixed inclusion of intrinsics in "pure" mode #92 +- Fixed CUDA support +- Fixed inclusion of intrinsics in "pure" mode #92 - Fixed language detection on GCC when the C++0x mode isn't enabled #95 - Added missing value_ptr for quaternions #99 - Added WINCE detection #92 From 54a395abd9a55b10173f2797d496a292f7613051 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 13 Aug 2013 23:22:16 +0200 Subject: [PATCH 16/21] Added Visual C++ 2013 detection --- glm/core/setup.hpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index 854e2ebb..798720a5 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -36,7 +36,7 @@ #define GLM_VERSION_MAJOR 0 #define GLM_VERSION_MINOR 9 #define GLM_VERSION_PATCH 4 -#define GLM_VERSION_REVISION 5 +#define GLM_VERSION_REVISION 6 /////////////////////////////////////////////////////////////////////////////////////////////////// // Platform @@ -77,20 +77,24 @@ // Report platform detection #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_PLATFORM_DISPLAYED)) # define GLM_MESSAGE_PLATFORM_DISPLAYED -# if(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) -# pragma message("GLM: Windows platform detected") +# if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO) +# pragma message("GLM: QNX platform detected") //# elif(GLM_PLATFORM & GLM_PLATFORM_IOS) //# pragma message("GLM: iOS platform detected") # elif(GLM_PLATFORM & GLM_PLATFORM_APPLE) # pragma message("GLM: Apple platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_WINCE) +# pragma message("GLM: WinCE platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) +# pragma message("GLM: Windows platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL) +# pragma message("GLM: Native Client detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) +# pragma message("GLM: Android platform detected") # elif(GLM_PLATFORM & GLM_PLATFORM_LINUX) # pragma message("GLM: Linux platform detected") # elif(GLM_PLATFORM & GLM_PLATFORM_UNIX) # pragma message("GLM: UNIX platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) -# pragma message("GLM: Android platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL) -# pragma message("GLM: Chrone Native Client detected") # elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN) # pragma message("GLM: platform unknown") # else @@ -118,6 +122,7 @@ #define GLM_COMPILER_VC2008 0x01000080 #define GLM_COMPILER_VC2010 0x01000090 #define GLM_COMPILER_VC2012 0x010000A0 +#define GLM_COMPILER_VC2013 0x010000B0 // GCC defines #define GLM_COMPILER_GCC 0x02000000 @@ -267,6 +272,8 @@ # define GLM_COMPILER GLM_COMPILER_VC2010 # elif _MSC_VER == 1700 # define GLM_COMPILER GLM_COMPILER_VC2012 +# elif _MSC_VER == 1800 +# define GLM_COMPILER GLM_COMPILER_VC2013 # else//_MSC_VER # define GLM_COMPILER GLM_COMPILER_VC # endif//_MSC_VER From d0e382592a1fcc0b920f3630e4b7ccea0ccf3e1b Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 18 Aug 2013 19:53:03 +0200 Subject: [PATCH 17/21] Fixed C++0X on VisualC++ 2012+ --- glm/core/setup.hpp | 4 ++-- readme.txt | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index 798720a5..f4e013c0 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -453,11 +453,11 @@ # elif(((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC) && defined(_MSC_EXTENSIONS)) # define GLM_LANG GLM_LANG_CXXMS # elif(((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC) && !defined(_MSC_EXTENSIONS)) -# if(GLM_COMPILER == GLM_COMPILER_VC2010) +# if(GLM_COMPILER >= GLM_COMPILER_VC2010) # define GLM_LANG GLM_LANG_CXX0X # else # define GLM_LANG GLM_LANG_CXX98 -# endif//(GLM_COMPILER == GLM_COMPILER_VC2010) +# endif # elif(__cplusplus >= 199711L) # define GLM_LANG GLM_LANG_CXX98 # else diff --git a/readme.txt b/readme.txt index 6fcb28aa..165708c2 100644 --- a/readme.txt +++ b/readme.txt @@ -36,6 +36,11 @@ GLM is a header only library, there is nothing to build, just include it. More informations in GLM manual: http://glm.g-truc.net/glm.pdf +================================================================================ +GLM 0.9.4.6: 2013-XX-XX +-------------------------------------------------------------------------------- + + ================================================================================ GLM 0.9.4.5: 2013-08-12 -------------------------------------------------------------------------------- From caf8f991cac75ab9b84a49478f228b73683e305b Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 18 Aug 2013 21:07:47 +0200 Subject: [PATCH 18/21] Fixed detection to select the last known compiler if newer version #106 --- glm/core/setup.hpp | 29 ++++++++--------------------- readme.txt | 5 +++-- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index f4e013c0..24326e5b 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -221,7 +221,7 @@ # define GLM_COMPILER GLM_COMPILER_INTEL12_0 # elif __INTEL_COMPILER == 1210 # define GLM_COMPILER GLM_COMPILER_INTEL12_1 -# elif __INTEL_COMPILER == 1300 +# elif __INTEL_COMPILER >= 1300 # define GLM_COMPILER GLM_COMPILER_INTEL13_0 # else # define GLM_COMPILER GLM_COMPILER_INTEL @@ -229,26 +229,11 @@ // CUDA #elif defined(__CUDACC__) -# define GLM_COMPILER GLM_COMPILER_CUDA -/* # if CUDA_VERSION < 3000 # error "GLM requires CUDA 3.0 or higher" -# elif CUDA_VERSION == 3000 -# define GLM_COMPILER GLM_COMPILER_CUDA30 -# elif CUDA_VERSION == 3010 -# define GLM_COMPILER GLM_COMPILER_CUDA31 -# elif CUDA_VERSION == 3020 -# define GLM_COMPILER GLM_COMPILER_CUDA32 -# elif CUDA_VERSION == 4000 -# define GLM_COMPILER GLM_COMPILER_CUDA40 -# elif CUDA_VERSION == 4010 -# define GLM_COMPILER GLM_COMPILER_CUDA41 -# elif CUDA_VERSION == 4020 -# define GLM_COMPILER GLM_COMPILER_CUDA42 # else # define GLM_COMPILER GLM_COMPILER_CUDA # endif -*/ // Visual C++ #elif defined(_MSC_VER) @@ -272,7 +257,7 @@ # define GLM_COMPILER GLM_COMPILER_VC2010 # elif _MSC_VER == 1700 # define GLM_COMPILER GLM_COMPILER_VC2012 -# elif _MSC_VER == 1800 +# elif _MSC_VER >= 1800 # define GLM_COMPILER GLM_COMPILER_VC2013 # else//_MSC_VER # define GLM_COMPILER GLM_COMPILER_VC @@ -302,7 +287,9 @@ # define GLM_COMPILER GLM_COMPILER_CLANG41 # elif(__clang_major__ == 4) && (__clang_minor__ == 2) # define GLM_COMPILER GLM_COMPILER_CLANG42 -# elif(__clang_major__ == 4) && (__clang_minor__ == 3) +# elif(__clang_major__ == 4) && (__clang_minor__ >= 3) +# define GLM_COMPILER GLM_COMPILER_CLANG43 +# elif(__clang_major__ > 4) # define GLM_COMPILER GLM_COMPILER_CLANG43 # else # define GLM_COMPILER GLM_COMPILER_CLANG @@ -336,10 +323,10 @@ # define GLM_COMPILER (GLM_COMPILER_GCC47) # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 8) # define GLM_COMPILER (GLM_COMPILER_GCC48) -# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 9) +# elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 9) +# define GLM_COMPILER (GLM_COMPILER_GCC49) +# elif (__GNUC__ > 4 ) # define GLM_COMPILER (GLM_COMPILER_GCC49) -# elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 0) -# define GLM_COMPILER (GLM_COMPILER_GCC50) # else # define GLM_COMPILER (GLM_COMPILER_GCC) # endif diff --git a/readme.txt b/readme.txt index 165708c2..6eececd3 100644 --- a/readme.txt +++ b/readme.txt @@ -37,9 +37,10 @@ More informations in GLM manual: http://glm.g-truc.net/glm.pdf ================================================================================ -GLM 0.9.4.6: 2013-XX-XX +GLM 0.9.4.6: 2013-08-XX -------------------------------------------------------------------------------- - +- Fixed detection to select the last known compiler if newer version #106 +- ================================================================================ GLM 0.9.4.5: 2013-08-12 From 1ab7271e7d0a6c8d2165ff179fe38465646dfad3 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 18 Aug 2013 21:33:13 +0200 Subject: [PATCH 19/21] Fixed is_int and is_uint code duplication with GCC and C++11 #107 --- glm/core/type_int.hpp | 8 +++++++- readme.txt | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/glm/core/type_int.hpp b/glm/core/type_int.hpp index 147559d1..c7de0c5a 100644 --- a/glm/core/type_int.hpp +++ b/glm/core/type_int.hpp @@ -47,13 +47,19 @@ namespace detail GLM_DETAIL_IS_INT(signed short); GLM_DETAIL_IS_INT(signed int); GLM_DETAIL_IS_INT(signed long); - GLM_DETAIL_IS_INT(highp_int_t); GLM_DETAIL_IS_UINT(unsigned char); GLM_DETAIL_IS_UINT(unsigned short); GLM_DETAIL_IS_UINT(unsigned int); GLM_DETAIL_IS_UINT(unsigned long); + +#if(GLM_LANG >= GLM_LANG_CXX0X) + GLM_DETAIL_IS_INT(signed long long); + GLM_DETAIL_IS_UINT(unsigned long long); +#else + GLM_DETAIL_IS_INT(highp_int_t); GLM_DETAIL_IS_UINT(highp_uint_t); +#endif }//namespace detail /// @addtogroup core_precision diff --git a/readme.txt b/readme.txt index f605b998..39888689 100644 --- a/readme.txt +++ b/readme.txt @@ -40,7 +40,7 @@ http://glm.g-truc.net/glm.pdf GLM 0.9.4.6: 2013-08-XX -------------------------------------------------------------------------------- - Fixed detection to select the last known compiler if newer version #106 -- +- Fixed is_int and is_uint code duplication with GCC and C++11 #107 ================================================================================ GLM 0.9.4.5: 2013-08-12 From da38a6e58c367a8275b901f5800f06273b4a85b4 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 20 Aug 2013 23:07:04 +0200 Subject: [PATCH 20/21] Better compiler detection in CMake. Language detection for Clang --- CMakeLists.txt | 40 +++++++++++++++++++++------------------- glm/core/setup.hpp | 35 ++++++++++++++++++++++++----------- readme.txt | 6 ++++++ 3 files changed, 51 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4772c854..a8053628 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,31 +11,33 @@ if(NOT GLM_TEST_ENABLE) message(FATAL_ERROR "GLM is a header only library, no need to build it. Set the option GLM_TEST_ENABLE with ON to build and run the test bench") endif() -option(GLM_TEST_ENABLE_CXX_11 "Enable C++ 11" OFF) -if(GLM_TEST_ENABLE_CXX_11) - if(CMAKE_COMPILER_IS_GNUCXX) - add_definitions(-std=c++0x) +if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") AND UNIX)) + option(GLM_TEST_ENABLE_CXX_98 "Enable C++ 98" OFF) + option(GLM_TEST_ENABLE_CXX_0X "Enable C++ 0x" OFF) + option(GLM_TEST_ENABLE_CXX_11 "Enable C++ 11" OFF) + option(GLM_TEST_ENABLE_CXX_1Y "Enable C++ 1y" OFF) + option(GLM_TEST_ENABLE_CXX_PEDANTIC "Pedantic" ON) + + if(GLM_TEST_ENABLE_CXX_PEDANTIC) + add_definitions(-pedantic) endif() -elseif(NOT GLM_TEST_ENABLE_CXX_11) - if(CMAKE_COMPILER_IS_GNUCXX) + + if(GLM_TEST_ENABLE_CXX_1Y) + add_definitions(-std=c++1y) + elseif(GLM_TEST_ENABLE_CXX_11) + add_definitions(-std=c++11) + elseif(GLM_TEST_ENABLE_CXX_0X) + add_definitions(-std=c++0x) + elseif(GLM_TEST_ENABLE_CXX_98) add_definitions(-std=c++98) endif() endif() -option(GLM_TEST_ENABLE_MS_EXTENSIONS "Enable MS extensions" OFF) -if(GLM_TEST_ENABLE_MS_EXTENSIONS) - if(CMAKE_COMPILER_IS_GNUCXX) - #Doesn't seem to work... - #add_definitions(-fms-extensions) - #add_definitions(-D_MSC_EXTENSIONS) - endif() -elseif(NOT GLM_TEST_ENABLE_MS_EXTENSIONS) - if(CMAKE_COMPILER_IS_GNUCXX) - add_definitions(-pedantic) - endif() +if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") OR (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") AND WIN32)) + option(GLM_TEST_ENABLE_MS_EXTENSIONS "Enable MS extensions" OFF) - if(MSVC) - add_definitions(/Za) + if(NOT GLM_TEST_ENABLE_MS_EXTENSIONS) + add_definitions(/Za) endif() endif() diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index 959425f2..f35458fe 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -110,6 +110,17 @@ #define GLM_COMPILER_UNKNOWN 0x00000000 +// Intel +#define GLM_COMPILER_INTEL 0x00100000 +#define GLM_COMPILER_INTEL9 0x00100010 +#define GLM_COMPILER_INTEL10_0 0x00100020 +#define GLM_COMPILER_INTEL10_1 0x00100030 +#define GLM_COMPILER_INTEL11_0 0x00100040 +#define GLM_COMPILER_INTEL11_1 0x00100050 +#define GLM_COMPILER_INTEL12_0 0x00100060 +#define GLM_COMPILER_INTEL12_1 0x00100070 +#define GLM_COMPILER_INTEL13_0 0x00100080 + // Visual C++ defines #define GLM_COMPILER_VC 0x01000000 #define GLM_COMPILER_VC2 0x01000010 @@ -187,17 +198,6 @@ // LLVM GCC #define GLM_COMPILER_LLVM_GCC 0x40000000 -// Intel -#define GLM_COMPILER_INTEL 0x80000000 -#define GLM_COMPILER_INTEL9 0x80000010 -#define GLM_COMPILER_INTEL10_0 0x80000020 -#define GLM_COMPILER_INTEL10_1 0x80000030 -#define GLM_COMPILER_INTEL11_0 0x80000040 -#define GLM_COMPILER_INTEL11_1 0x80000050 -#define GLM_COMPILER_INTEL12_0 0x80000060 -#define GLM_COMPILER_INTEL12_1 0x80000070 -#define GLM_COMPILER_INTEL13_0 0x80000080 - // Build model #define GLM_MODEL_32 0x00000010 #define GLM_MODEL_64 0x00000020 @@ -431,6 +431,19 @@ #else # if(__cplusplus >= 201103L) # define GLM_LANG GLM_LANG_CXX11 +# elif((GLM_COMPILER & GLM_COMPILER_CLANG) == GLM_COMPILER_CLANG) +# if(GLM_PLATFORM == GLM_PLATFORM_APPLE) +# define GLM_DETAIL_MAJOR 1 +# else +# define GLM_DETAIL_MAJOR 0 +# endif +# if(__clang_major__ < (2 + GLM_DETAIL_MAJOR)) +# define GLM_LANG GLM_LANG_CXX +# elif(__has_feature(cxx_auto_type)) +# define GLM_LANG GLM_LANG_CXX0X +# else +# define GLM_LANG GLM_LANG_CXX98 +# endif # elif((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) # if defined(__GXX_EXPERIMENTAL_CXX0X__) # define GLM_LANG GLM_LANG_CXX0X diff --git a/readme.txt b/readme.txt index 39888689..720a9846 100644 --- a/readme.txt +++ b/readme.txt @@ -41,6 +41,12 @@ GLM 0.9.4.6: 2013-08-XX -------------------------------------------------------------------------------- - Fixed detection to select the last known compiler if newer version #106 - Fixed is_int and is_uint code duplication with GCC and C++11 #107 +- Fixed test suite build while using Clang in C++11 mode +- Added c++1y mode support in CMake test suite +- Removed ms extension mode to CMake when no using Visual C++ +- Added pedantic mode to CMake test suite for Clang and GCC +- Added use of GCC frontend on Unix for ICC and Visual C++ fronted on Windows + for ICC ================================================================================ GLM 0.9.4.5: 2013-08-12 From 9464e5b5909c430b9d613030b6113463744e3cc0 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 20 Aug 2013 23:25:38 +0200 Subject: [PATCH 21/21] Added error for unsupported compiler versions --- glm/core/setup.hpp | 32 ++++++-------------------------- readme.txt | 1 + test/core/core_func_integer.cpp | 13 ++----------- 3 files changed, 9 insertions(+), 37 deletions(-) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index f35458fe..7a9d5c71 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -154,8 +154,6 @@ #define GLM_COMPILER_GCC46 0x020000D0 #define GLM_COMPILER_GCC47 0x020000E0 #define GLM_COMPILER_GCC48 0x020000F0 -#define GLM_COMPILER_GCC49 0x02000100 -#define GLM_COMPILER_GCC50 0x02000200 // G++ command line to display defined // echo "" | g++ -E -dM -x c++ - | sort @@ -237,18 +235,8 @@ // Visual C++ #elif defined(_MSC_VER) -# if _MSC_VER == 900 -# define GLM_COMPILER GLM_COMPILER_VC2 -# elif _MSC_VER == 1000 -# define GLM_COMPILER GLM_COMPILER_VC4 -# elif _MSC_VER == 1100 -# define GLM_COMPILER GLM_COMPILER_VC5 -# elif _MSC_VER == 1200 -# define GLM_COMPILER GLM_COMPILER_VC6 -# elif _MSC_VER == 1300 -# define GLM_COMPILER GLM_COMPILER_VC2002 -# elif _MSC_VER == 1310 -# define GLM_COMPILER GLM_COMPILER_VC2003 +# if _MSC_VER < 1400 +# error "GLM requires Visual C++ 2005 or higher" # elif _MSC_VER == 1400 # define GLM_COMPILER GLM_COMPILER_VC2005 # elif _MSC_VER == 1500 @@ -265,7 +253,9 @@ // Clang #elif defined(__clang__) -# if(__clang_major__ == 2) && (__clang_minor__ == 6) +# if (__clang_major__ <= 1) || ((__clang_major__ == 2) && (__clang_minor__ < 6)) +# error "GLM requires Clang 2.6 or higher" +# elif(__clang_major__ == 2) && (__clang_minor__ == 6) # define GLM_COMPILER GLM_COMPILER_CLANG26 # elif(__clang_major__ == 2) && (__clang_minor__ == 7) # define GLM_COMPILER GLM_COMPILER_CLANG27 @@ -333,17 +323,7 @@ // Borland C++ #elif defined(_BORLANDC_) -# if defined(VER125) -# define GLM_COMPILER GLM_COMPILER_BCB4 -# elif defined(VER130) -# define GLM_COMPILER GLM_COMPILER_BCB5 -# elif defined(VER140) -# define GLM_COMPILER GLM_COMPILER_BCB6 -# elif defined(VER200) -# define GLM_COMPILER GLM_COMPILER_BCB2009 -# else -# define GLM_COMPILER GLM_COMPILER_BC -# endif +# define GLM_COMPILER GLM_COMPILER_BC // Codewarrior #elif defined(__MWERKS__) diff --git a/readme.txt b/readme.txt index 720a9846..b1a0d41e 100644 --- a/readme.txt +++ b/readme.txt @@ -47,6 +47,7 @@ GLM 0.9.4.6: 2013-08-XX - Added pedantic mode to CMake test suite for Clang and GCC - Added use of GCC frontend on Unix for ICC and Visual C++ fronted on Windows for ICC +- Added compilation errors for unsupported compiler versions ================================================================================ GLM 0.9.4.5: 2013-08-12 diff --git a/test/core/core_func_integer.cpp b/test/core/core_func_integer.cpp index 068270f7..0bcc560a 100644 --- a/test/core/core_func_integer.cpp +++ b/test/core/core_func_integer.cpp @@ -170,15 +170,7 @@ namespace findMSB {0x08000000, 27}, {0x10000000, 28}, {0x20000000, 29}, - {0x40000000, 30}, - {0x80000000, 30}, - {0xffffffff, -1}, - {0xfffffffe, 0}, - {0xfffffffd, 1}, - {0xfffffffc, 1}, - {0xfffffffb, 2}, - {0xfffffffa, 2}, - {0xfffffff0, 3} + {0x40000000, 30} }; int test() @@ -209,8 +201,7 @@ namespace findLSB { {0x00000001, 0}, {0x00000003, 0}, - {0x00000002, 1}, - {0x80000000, 31} + {0x00000002, 1} }; int test()