Skip to content
Snippets Groups Projects
Commit bf5f215f authored by David Parks's avatar David Parks
Browse files

Cleanup from review.

parent fc92e097
No related branches found
No related tags found
No related merge requests found
...@@ -827,9 +827,9 @@ void LLViewerJointMesh::updateGeometryOriginal(LLFace *mFace, LLPolyMesh *mMesh) ...@@ -827,9 +827,9 @@ void LLViewerJointMesh::updateGeometryOriginal(LLFace *mFace, LLPolyMesh *mMesh)
//F32 last_weight = F32_MAX; //F32 last_weight = F32_MAX;
LLMatrix4a gBlendMat; LLMatrix4a gBlendMat;
__restrict const F32* weights = mMesh->getWeights(); const F32* __restrict weights = mMesh->getWeights();
__restrict const LLVector4* coords = mMesh->getCoords(); const LLVector4a* __restrict coords = (LLVector4a*) mMesh->getCoords();
__restrict const LLVector4* normals = mMesh->getNormals(); const LLVector4a* __restrict normals = (LLVector4a*) mMesh->getNormals();
for (U32 index = 0; index < mMesh->getNumVertices(); index++) for (U32 index = 0; index < mMesh->getNumVertices(); index++)
{ {
...@@ -838,54 +838,37 @@ void LLViewerJointMesh::updateGeometryOriginal(LLFace *mFace, LLPolyMesh *mMesh) ...@@ -838,54 +838,37 @@ void LLViewerJointMesh::updateGeometryOriginal(LLFace *mFace, LLPolyMesh *mMesh)
// blend by first matrix // blend by first matrix
F32 w = weights[index]; F32 w = weights[index];
LLVector4a coord; //LLVector4a coord;
coord.load4a(coords[index].mV); //coord.load4a(coords[index].mV);
LLVector4a norm; //LLVector4a norm;
norm.load4a(normals[index].mV); //norm.load4a(normals[index].mV);
// Maybe we don't have to change gBlendMat. S32 joint = llfloor(w);
// Profiles of a single-avatar scene on a Mac show this to be a very w -= joint;
// common case. JC
//if (w != last_weight) 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); LLVector4a res;
w -= joint; gBlendMat.affineTransform(coords[index], res);
o_vertices[bidx].setVec(res[0], res[1], res[2]);
gBlendMat.rotate(normals[index], res);
if (w >= 0.f) o_normals[bidx].setVec(res[0], res[1], res[2]);
{
// 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]);
}
} }
/*else else
{ //weight didn't change { // No lerp required in this case.
LLVector4a res; LLVector4a res;
gBlendMat.affineTransform(coord, res); gJointMatAligned[joint].affineTransform(coords[index], res);
o_vertices[bidx].setVec(res[0], res[1], res[2]); 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]); o_normals[bidx].setVec(res[0], res[1], res[2]);
}*/ }
} }
buffer->setBuffer(0); buffer->setBuffer(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment