From 30dca2d0c7504768a3ecb4752243922e76ddc4c6 Mon Sep 17 00:00:00 2001 From: Dave Reid Date: Tue, 23 Apr 2013 09:09:37 +1000 Subject: [PATCH 1/4] Fix an ambiguity error with clamp(). --- glm/core/func_common.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/core/func_common.hpp b/glm/core/func_common.hpp index eb66de7d..ce246010 100644 --- a/glm/core/func_common.hpp +++ b/glm/core/func_common.hpp @@ -208,7 +208,7 @@ namespace glm genType const & minVal, genType const & maxVal); - template + template genType clamp( genType const & x, typename genType::value_type const & minVal, From 5519b86003928ffc55dd346941b0a0fb0e75374e Mon Sep 17 00:00:00 2001 From: Dave Reid Date: Tue, 23 Apr 2013 09:19:57 +1000 Subject: [PATCH 2/4] Fix fvec4SIMD and fmat4x4SIMD compilation errors. --- glm/gtx/simd_mat4.hpp | 4 ++-- glm/gtx/simd_mat4.inl | 6 +++--- glm/gtx/simd_vec4.hpp | 6 +++--- glm/gtx/simd_vec4.inl | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/glm/gtx/simd_mat4.hpp b/glm/gtx/simd_mat4.hpp index b435b11e..5acb81bc 100644 --- a/glm/gtx/simd_mat4.hpp +++ b/glm/gtx/simd_mat4.hpp @@ -90,7 +90,7 @@ namespace detail fvec4SIMD const & v2, fvec4SIMD const & v3); explicit fmat4x4SIMD( - tmat4x4 const & m); + mat4x4 const & m); explicit fmat4x4SIMD( __m128 const in[4]); @@ -163,7 +163,7 @@ namespace detail //! Convert a simdMat4 to a mat4. //! (From GLM_GTX_simd_mat4 extension) - detail::tmat4x4 mat4_cast( + mat4 mat4_cast( detail::fmat4x4SIMD const & x); //! Multiply matrix x by matrix y component-wise, i.e., diff --git a/glm/gtx/simd_mat4.inl b/glm/gtx/simd_mat4.inl index d6ec8ca9..a5e2b68a 100644 --- a/glm/gtx/simd_mat4.inl +++ b/glm/gtx/simd_mat4.inl @@ -73,7 +73,7 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD ( - tmat4x4 const & m + mat4 const & m ) { this->Data[0] = fvec4SIMD(m[0]); @@ -520,12 +520,12 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD const operator++ }//namespace detail -GLM_FUNC_QUALIFIER detail::tmat4x4 mat4_cast +GLM_FUNC_QUALIFIER mat4 mat4_cast ( detail::fmat4x4SIMD const & x ) { - GLM_ALIGN(16) detail::tmat4x4 Result; + GLM_ALIGN(16) mat4 Result; _mm_store_ps(&Result[0][0], x.Data[0].Data); _mm_store_ps(&Result[1][0], x.Data[1].Data); _mm_store_ps(&Result[2][0], x.Data[2].Data); diff --git a/glm/gtx/simd_vec4.hpp b/glm/gtx/simd_vec4.hpp index 67f10501..927e7df8 100644 --- a/glm/gtx/simd_vec4.hpp +++ b/glm/gtx/simd_vec4.hpp @@ -76,7 +76,7 @@ namespace detail static size_type value_size(); typedef fvec4SIMD type; - typedef tvec4 bool_type; + typedef tvec4 bool_type; #ifdef GLM_SIMD_ENABLE_XYZW_UNION union @@ -108,7 +108,7 @@ namespace detail float const & z, float const & w); explicit fvec4SIMD( - tvec4 const & v); + vec4 const & v); //////////////////////////////////////// //// Convertion vector constructors @@ -161,7 +161,7 @@ namespace detail //! Convert a simdVec4 to a vec4. //! (From GLM_GTX_simd_vec4 extension) - detail::tvec4 vec4_cast( + vec4 vec4_cast( detail::fvec4SIMD const & x); //! Returns x if x >= 0; otherwise, it returns -x. diff --git a/glm/gtx/simd_vec4.inl b/glm/gtx/simd_vec4.inl index 0b22115d..a71c550d 100644 --- a/glm/gtx/simd_vec4.inl +++ b/glm/gtx/simd_vec4.inl @@ -33,7 +33,7 @@ GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(fvec4SIMD const & v) : Data(v.Data) {} -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(tvec4 const & v) : +GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(vec4 const & v) : Data(_mm_set_ps(v.w, v.z, v.y, v.x)) {} @@ -269,12 +269,12 @@ GLM_FUNC_QUALIFIER fvec4SIMD operator-- (fvec4SIMD const & v, int) }//namespace detail -GLM_FUNC_QUALIFIER detail::tvec4 vec4_cast +GLM_FUNC_QUALIFIER vec4 vec4_cast ( detail::fvec4SIMD const & x ) { - GLM_ALIGN(16) detail::tvec4 Result; + GLM_ALIGN(16) vec4 Result; _mm_store_ps(&Result[0], x.Data); return Result; } From b6d994f6382f94e8e779c4185d1d785eb91dbd31 Mon Sep 17 00:00:00 2001 From: Dave Reid Date: Tue, 23 Apr 2013 10:01:50 +1000 Subject: [PATCH 3/4] Compilation fixes due to missing P template parameters. --- glm/gtc/matrix_transform.inl | 4 ++-- glm/gtx/fast_exponential.inl | 12 ++++++------ glm/gtx/fast_square_root.inl | 30 +++++++++++++++--------------- glm/gtx/normal.hpp | 2 +- glm/gtx/normal.inl | 2 +- glm/gtx/orthonormalize.hpp | 4 ++-- glm/gtx/orthonormalize.inl | 4 ++-- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index 6bd9a184..cb6fdd73 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -339,7 +339,7 @@ namespace glm return Result; } - template + template GLM_FUNC_QUALIFIER detail::tvec3 project ( detail::tvec3 const & obj, @@ -360,7 +360,7 @@ namespace glm return detail::tvec3(tmp); } - template + template GLM_FUNC_QUALIFIER detail::tvec3 unProject ( detail::tvec3 const & win, diff --git a/glm/gtx/fast_exponential.inl b/glm/gtx/fast_exponential.inl index 5d957dab..790fabba 100644 --- a/glm/gtx/fast_exponential.inl +++ b/glm/gtx/fast_exponential.inl @@ -27,20 +27,20 @@ namespace glm return f; } - template + template GLM_FUNC_QUALIFIER detail::tvec2 fastPow( const detail::tvec2& x, - const detail::tvec2& y) + const detail::tvec2& y) { return detail::tvec2( fastPow(x.x, y.x), fastPow(x.y, y.y)); } - template + template GLM_FUNC_QUALIFIER detail::tvec3 fastPow( const detail::tvec3& x, - const detail::tvec3& y) + const detail::tvec3& y) { return detail::tvec3( fastPow(x.x, y.x), @@ -48,10 +48,10 @@ namespace glm fastPow(x.z, y.z)); } - template + template GLM_FUNC_QUALIFIER detail::tvec4 fastPow( const detail::tvec4& x, - const detail::tvec4& y) + const detail::tvec4& y) { return detail::tvec4( fastPow(x.x, y.x), diff --git a/glm/gtx/fast_square_root.inl b/glm/gtx/fast_square_root.inl index 0f51fbbd..12838e66 100644 --- a/glm/gtx/fast_square_root.inl +++ b/glm/gtx/fast_square_root.inl @@ -53,30 +53,30 @@ namespace glm return abs(x); } - template + template GLM_FUNC_QUALIFIER valType fastLength ( - detail::tvec2 const & x + detail::tvec2 const & x ) { valType sqr = x.x * x.x + x.y * x.y; return fastSqrt(sqr); } - template + template GLM_FUNC_QUALIFIER valType fastLength ( - detail::tvec3 const & x + detail::tvec3 const & x ) { valType sqr = x.x * x.x + x.y * x.y + x.z * x.z; return fastSqrt(sqr); } - template + template GLM_FUNC_QUALIFIER valType fastLength ( - detail::tvec4 const & x + detail::tvec4 const & x ) { valType sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; @@ -104,30 +104,30 @@ namespace glm return x > genType(0) ? genType(1) : -genType(1); } - template - GLM_FUNC_QUALIFIER detail::tvec2 fastNormalize + template + GLM_FUNC_QUALIFIER detail::tvec2 fastNormalize ( - detail::tvec2 const & x + detail::tvec2 const & x ) { valType sqr = x.x * x.x + x.y * x.y; return x * fastInverseSqrt(sqr); } - template - GLM_FUNC_QUALIFIER detail::tvec3 fastNormalize + template + GLM_FUNC_QUALIFIER detail::tvec3 fastNormalize ( - detail::tvec3 const & x + detail::tvec3 const & x ) { valType sqr = x.x * x.x + x.y * x.y + x.z * x.z; return x * fastInverseSqrt(sqr); } - template - GLM_FUNC_QUALIFIER detail::tvec4 fastNormalize + template + GLM_FUNC_QUALIFIER detail::tvec4 fastNormalize ( - detail::tvec4 const & x + detail::tvec4 const & x ) { valType sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; diff --git a/glm/gtx/normal.hpp b/glm/gtx/normal.hpp index e0392136..1a43ab80 100644 --- a/glm/gtx/normal.hpp +++ b/glm/gtx/normal.hpp @@ -53,7 +53,7 @@ namespace glm //! Computes triangle normal from triangle points. //! From GLM_GTX_normal extension. - template + template detail::tvec3 triangleNormal( detail::tvec3 const & p1, detail::tvec3 const & p2, diff --git a/glm/gtx/normal.inl b/glm/gtx/normal.inl index 2dceb6a6..0846d899 100644 --- a/glm/gtx/normal.inl +++ b/glm/gtx/normal.inl @@ -9,7 +9,7 @@ namespace glm { - template + template GLM_FUNC_QUALIFIER detail::tvec3 triangleNormal ( detail::tvec3 const & p1, diff --git a/glm/gtx/orthonormalize.hpp b/glm/gtx/orthonormalize.hpp index 7eeb0c79..d81b4e38 100644 --- a/glm/gtx/orthonormalize.hpp +++ b/glm/gtx/orthonormalize.hpp @@ -53,13 +53,13 @@ namespace glm //! Returns the orthonormalized matrix of m. //! From GLM_GTX_orthonormalize extension. - template + template detail::tmat3x3 orthonormalize( const detail::tmat3x3& m); //! Orthonormalizes x according y. //! From GLM_GTX_orthonormalize extension. - template + template detail::tvec3 orthonormalize( const detail::tvec3& x, const detail::tvec3& y); diff --git a/glm/gtx/orthonormalize.inl b/glm/gtx/orthonormalize.inl index a9f40a5f..939080f0 100644 --- a/glm/gtx/orthonormalize.inl +++ b/glm/gtx/orthonormalize.inl @@ -9,7 +9,7 @@ namespace glm { - template + template GLM_FUNC_QUALIFIER detail::tmat3x3 orthonormalize ( const detail::tmat3x3& m @@ -31,7 +31,7 @@ namespace glm return r; } - template + template GLM_FUNC_QUALIFIER detail::tvec3 orthonormalize ( const detail::tvec3& x, From 6a7ccdb5301e27a8f35da07ec7ae4cfc94f75d1a Mon Sep 17 00:00:00 2001 From: Dave Reid Date: Tue, 23 Apr 2013 14:18:05 +1000 Subject: [PATCH 4/4] Fix another compilation error. --- glm/gtx/fast_square_root.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtx/fast_square_root.inl b/glm/gtx/fast_square_root.inl index 12838e66..aef9ad0d 100644 --- a/glm/gtx/fast_square_root.inl +++ b/glm/gtx/fast_square_root.inl @@ -36,7 +36,7 @@ namespace glm i = 0x5f375a86 - (i >> 1); //x = *(float*)&i; //x = *((float*)(char*)&i); - tmp = detail::uif(i).f; + tmp = detail::uif32(i).f; tmp = tmp * (1.5f - xhalf * tmp * tmp); return genType(tmp); }