diff options
author | Dave Parks <davep@lindenlab.com> | 2010-05-20 02:46:01 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2010-05-20 02:46:01 -0500 |
commit | bf5f215fbc29102cfd8b5418f29ea0ed6edd14ee (patch) | |
tree | 710c8438bafd65fc3c5e7547f365a16aa04bb11a /indra/newview | |
parent | fc92e097cba5344d3dbbca0a325f0d3fac9d8c36 (diff) |
Cleanup from review.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llviewerjointmesh.cpp | 69 |
1 files changed, 26 insertions, 43 deletions
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 294dfdcb55..236ad98d68 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -827,9 +827,9 @@ void LLViewerJointMesh::updateGeometryOriginal(LLFace *mFace, LLPolyMesh *mMesh) //F32 last_weight = F32_MAX; LLMatrix4a gBlendMat; - __restrict const F32* weights = mMesh->getWeights(); - __restrict const LLVector4* coords = mMesh->getCoords(); - __restrict const LLVector4* normals = mMesh->getNormals(); + const F32* __restrict weights = mMesh->getWeights(); + const LLVector4a* __restrict coords = (LLVector4a*) mMesh->getCoords(); + const LLVector4a* __restrict normals = (LLVector4a*) mMesh->getNormals(); for (U32 index = 0; index < mMesh->getNumVertices(); index++) { @@ -838,54 +838,37 @@ void LLViewerJointMesh::updateGeometryOriginal(LLFace *mFace, LLPolyMesh *mMesh) // blend by first matrix F32 w = weights[index]; - LLVector4a coord; - coord.load4a(coords[index].mV); + //LLVector4a coord; + //coord.load4a(coords[index].mV); - LLVector4a norm; - norm.load4a(normals[index].mV); + //LLVector4a norm; + //norm.load4a(normals[index].mV); - // Maybe we don't have to change gBlendMat. - // Profiles of a single-avatar scene on a Mac show this to be a very - // common case. JC - //if (w != last_weight) + S32 joint = llfloor(w); + w -= joint; + + if (w > 0.f) { - //last_weight = w; + // Try to keep all the accesses to the matrix data as close + // together as possible. This function is a hot spot on the + // Mac. JC + gBlendMat.setLerp(gJointMatAligned[joint+0], + gJointMatAligned[joint+1], w); - S32 joint = llfloor(w); - w -= joint; - - - if (w >= 0.f) - { - // Try to keep all the accesses to the matrix data as close - // together as possible. This function is a hot spot on the - // Mac. JC - gBlendMat.setLerp(gJointMatAligned[joint+0], - gJointMatAligned[joint+1], w); - - LLVector4a res; - gBlendMat.affineTransform(coord, res); - o_vertices[bidx].setVec(res[0], res[1], res[2]); - gBlendMat.rotate(norm, res); - o_normals[bidx].setVec(res[0], res[1], res[2]); - } - else - { // No lerp required in this case. - LLVector4a res; - gJointMatAligned[joint].affineTransform(coord, res); - o_vertices[bidx].setVec(res[0], res[1], res[2]); - gJointMatAligned[joint].rotate(norm, res); - o_normals[bidx].setVec(res[0], res[1], res[2]); - } + LLVector4a res; + gBlendMat.affineTransform(coords[index], res); + o_vertices[bidx].setVec(res[0], res[1], res[2]); + gBlendMat.rotate(normals[index], res); + o_normals[bidx].setVec(res[0], res[1], res[2]); } - /*else - { //weight didn't change + else + { // No lerp required in this case. LLVector4a res; - gBlendMat.affineTransform(coord, res); + gJointMatAligned[joint].affineTransform(coords[index], res); o_vertices[bidx].setVec(res[0], res[1], res[2]); - gBlendMat.rotate(norm, res); + gJointMatAligned[joint].rotate(normals[index], res); o_normals[bidx].setVec(res[0], res[1], res[2]); - }*/ + } } buffer->setBuffer(0); |