Added missing SIMD implementations

This commit is contained in:
Christophe Riccio 2011-01-28 17:06:57 +00:00
parent 316b4befae
commit a511553d8e
3 changed files with 19 additions and 3 deletions

View File

@ -134,6 +134,13 @@ namespace glm
{
typedef detail::fmat4x4SIMD simd_mat4;
//! Multiply matrix x by matrix y component-wise, i.e.,
//! result[i][j] is the scalar product of x[i][j] and y[i][j].
//! (From GLM_GTX_simd_mat4 extension).
detail::fmat4x4SIMD simd_matrixCompMult(
detail::fmat4x4SIMD const & x,
detail::fmat4x4SIMD const & y);
//! Returns the transposed matrix of x
//! (From GLM_GTX_simd_mat4 extension).
detail::fmat4x4SIMD simd_transpose(detail::fmat4x4SIMD const & m);

View File

@ -237,13 +237,18 @@ namespace detail
namespace gtx{
namespace simd_mat4
{
inline detail::fmat4x4SIMD matrixCompMult
inline detail::fmat4x4SIMD simd_matrixCompMult
(
detail::fmat4x4SIMD const & x,
detail::fmat4x4SIMD const & y
)
{
//GLM_STATIC_ASSERT(0, "TODO");
detail::fmat4x4SIMD result;
result[0] = x[0] * y[0];
result[1] = x[1] * y[1];
result[2] = x[2] * y[2];
result[3] = x[3] * y[3];
return result;
}
inline detail::fmat4x4SIMD simd_transpose(detail::fmat4x4SIMD const & m)
@ -255,7 +260,9 @@ namespace simd_mat4
inline float simd_determinant(detail::fmat4x4SIMD const & m)
{
//GLM_STATIC_ASSERT(0, "TODO");
float Result;
_mm_store_ss(&Result, detail::sse_det_ps(&m[0].Data));
return Result;
}
inline detail::fmat4x4SIMD simd_inverse(detail::fmat4x4SIMD const & m)

View File

@ -274,6 +274,8 @@ int main()
Failed += test_compute_glm();
Failed += test_compute_gtx();
float Det = glm::simd_determinant(glm::simd_mat4(1.0));
glm::simd_mat4 B = glm::simd_matrixCompMult(glm::simd_mat4(1.0), glm::simd_mat4(1.0));
system("pause");