diff --git a/glm/gtx/simd_mat4.hpp b/glm/gtx/simd_mat4.hpp index 7f19400b..3b2a892b 100644 --- a/glm/gtx/simd_mat4.hpp +++ b/glm/gtx/simd_mat4.hpp @@ -125,6 +125,18 @@ namespace glm { typedef detail::fmat4x4SIMD simd_mat4; + //! Returns the transposed matrix of x + //! (From GLM_GTX_simd_mat4 extension). + detail::fmat4x4SIMD simd_transpose(detail::fmat4x4SIMD const & m); + + //! Return the determinant of a mat4 matrix. + //! (From GLM_GTX_simd_mat4 extension). + float simd_determinant(detail::fmat4x4SIMD const & m); + + //! Return the inverse of a mat4 matrix. + //! (From GLM_GTX_simd_mat4 extension). + detail::fmat4x4SIMD simd_inverse(detail::fmat4x4SIMD const & m); + }//namespace simd_mat4 }//namespace gtx }//namespace glm diff --git a/glm/gtx/simd_mat4.inl b/glm/gtx/simd_mat4.inl index 30c91b49..1eb1afe3 100644 --- a/glm/gtx/simd_mat4.inl +++ b/glm/gtx/simd_mat4.inl @@ -218,4 +218,38 @@ namespace detail } }//namespace detail + +namespace gtx{ +namespace simd_mat4 +{ + inline detail::fmat4x4SIMD matrixCompMult + ( + detail::fmat4x4SIMD const & x, + detail::fmat4x4SIMD const & y + ) + { + GLM_STATIC_ASSERT(0, "TODO"); + } + + inline detail::fmat4x4SIMD simd_transpose(detail::fmat4x4SIMD const & m) + { + detail::fmat4x4SIMD result; + _mm_transpose_ps(&m[0].Data, &result[0].Data); + return result; + } + + inline float simd_determinant(detail::fmat4x4SIMD const & m) + { + GLM_STATIC_ASSERT(0, "TODO"); + } + + inline detail::fmat4x4SIMD simd_inverse(detail::fmat4x4SIMD const & m) + { + detail::fmat4x4SIMD result; + _mm_inverse_ps(&m[0].Data, &result[0].Data); + return result; + } +}//namespace simd_mat4 +}//namespace gtx + }//namespace glm diff --git a/glm/gtx/simd_vec4.inl b/glm/gtx/simd_vec4.inl index b782096e..1ee922ed 100644 --- a/glm/gtx/simd_vec4.inl +++ b/glm/gtx/simd_vec4.inl @@ -163,7 +163,8 @@ namespace glm template inline fvec4SIMD& fvec4SIMD::swizzle() { - this->Data = _mm_shuffle_ps(this->Data, this->Data, (((int(d) << 6) | (int(c) << 4) | (int(b) << 2) | (int(a) << 0)))); + enum{mask = (((int(d) << 6) | (int(c) << 4) | (int(b) << 2) | (int(a) << 0)))}; + this->Data = _mm_shuffle_ps(this->Data, this->Data, mask); return *this; }