diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-09-28 15:43:07 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-09-28 15:43:07 -0400 |
commit | 8d6bb9ee4e9def306454e9ecda1980793dcf7ad5 (patch) | |
tree | f7c4bbbb98f7deac7ea54d6dca49fced89f64d23 /indra/newview/llskinningutil.cpp | |
parent | e6297ab3d6262014d3b501703154437bea523be1 (diff) |
SL-451 - SSE-optimized matrix multiply, used in initSkinningMatrixPalette()
Diffstat (limited to 'indra/newview/llskinningutil.cpp')
-rw-r--r-- | indra/newview/llskinningutil.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index e1333b8352..3ad30dac69 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -243,8 +243,6 @@ void LLSkinningUtil::initSkinningMatrixPalette( const LLMeshSkinInfo* skin, LLVOAvatar *avatar) { - // BENTO - switching to use Matrix4a and SSE might speed this up. - // Note that we are mostly passing Matrix4a's to this routine anyway, just dubiously casted. for (U32 j = 0; j < count; ++j) { LLJoint *joint = NULL; @@ -260,13 +258,23 @@ void LLSkinningUtil::initSkinningMatrixPalette( { joint = avatar->getJoint(skin->mJointNums[j]); } - mat[j] = skin->mInvBindMatrix[j]; if (joint) { +#define MAT_USE_SSE +#ifdef MAT_USE_SSE + LLMatrix4a bind, world, res; + bind.loadu(skin->mInvBindMatrix[j]); + world.loadu(joint->getWorldMatrix()); + matMul(bind,world,res); + memcpy(mat[j].mMatrix,res.mMatrix,16*sizeof(float)); +#else + mat[j] = skin->mInvBindMatrix[j]; mat[j] *= joint->getWorldMatrix(); +#endif } else { + mat[j] = skin->mInvBindMatrix[j]; // This shouldn't happen - in mesh upload, skinned // rendering should be disabled unless all joints are // valid. In other cases of skinned rendering, invalid |