summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerjointmesh.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-08-24 18:44:39 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-08-24 18:44:39 +0100
commit98cc2365034a93c69704daa69efb389799cc9627 (patch)
tree4c3ec75b78a26a736f18a2153af025040ae05a4b /indra/newview/llviewerjointmesh.cpp
parent6ba23344c95157793af9e4154933ae8df61630e8 (diff)
Backed out changeset a62bf7c0af21
Backing out this merge that I pushed (prematurely) to the wrong place.
Diffstat (limited to 'indra/newview/llviewerjointmesh.cpp')
-rw-r--r--indra/newview/llviewerjointmesh.cpp103
1 files changed, 15 insertions, 88 deletions
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index ae2aa41b3a..d2c29adf27 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -661,9 +661,7 @@ void LLViewerJointMesh::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32
//-----------------------------------------------------------------------------
// updateFaceData()
//-----------------------------------------------------------------------------
-static LLFastTimer::DeclareTimer FTM_AVATAR_FACE("Avatar Face");
-
-void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update)
+void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind)
{
mFace = face;
@@ -672,8 +670,6 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w
return;
}
- LLFastTimer t(FTM_AVATAR_FACE);
-
LLStrider<LLVector3> verticesp;
LLStrider<LLVector3> normalsp;
LLStrider<LLVector2> tex_coordsp;
@@ -692,98 +688,29 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w
face->mVertexBuffer->getIndexStrider(indicesp);
stop_glerror();
- verticesp += mMesh->mFaceVertexOffset;
- tex_coordsp += mMesh->mFaceVertexOffset;
- normalsp += mMesh->mFaceVertexOffset;
- vertex_weightsp += mMesh->mFaceVertexOffset;
- clothing_weightsp += mMesh->mFaceVertexOffset;
-
- const U32* __restrict coords = (U32*) mMesh->getCoords();
- const U32* __restrict tex_coords = (U32*) mMesh->getTexCoords();
- const U32* __restrict normals = (U32*) mMesh->getNormals();
- const U32* __restrict weights = (U32*) mMesh->getWeights();
- const U32* __restrict cloth_weights = (U32*) mMesh->getClothingWeights();
-
- const U32 num_verts = mMesh->getNumVertices();
-
- U32 i = 0;
-
- const U32 skip = verticesp.getSkip()/sizeof(U32);
-
- U32* __restrict v = (U32*) verticesp.get();
- U32* __restrict n = (U32*) normalsp.get();
-
- if (terse_update)
+ for (U16 i = 0; i < mMesh->getNumVertices(); i++)
{
- for (S32 i = num_verts; i > 0; --i)
+ verticesp[mMesh->mFaceVertexOffset + i] = *(mMesh->getCoords() + i);
+ tex_coordsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getTexCoords() + i);
+ normalsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getNormals() + i);
+ vertex_weightsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getWeights() + i);
+ if (damp_wind)
{
- //morph target application only, only update positions and normals
- v[0] = coords[0];
- v[1] = coords[1];
- v[2] = coords[2];
- coords += 3;
- v += skip;
+ clothing_weightsp[mMesh->mFaceVertexOffset + i] = LLVector4(0,0,0,0);
}
-
- for (S32 i = num_verts; i > 0; --i)
+ else
{
- n[0] = normals[0];
- n[1] = normals[1];
- n[2] = normals[2];
- normals += 3;
- n += skip;
+ clothing_weightsp[mMesh->mFaceVertexOffset + i] = (*(mMesh->getClothingWeights() + i));
}
}
- else
- {
- U32* __restrict tc = (U32*) tex_coordsp.get();
- U32* __restrict vw = (U32*) vertex_weightsp.get();
- U32* __restrict cw = (U32*) clothing_weightsp.get();
-
- do
- {
- v[0] = *(coords++);
- v[1] = *(coords++);
- v[2] = *(coords++);
- v += skip;
-
- tc[0] = *(tex_coords++);
- tc[1] = *(tex_coords++);
- tc += skip;
-
- n[0] = *(normals++);
- n[1] = *(normals++);
- n[2] = *(normals++);
- n += skip;
-
- vw[0] = *(weights++);
- vw += skip;
-
- cw[0] = *(cloth_weights++);
- cw[1] = *(cloth_weights++);
- cw[2] = *(cloth_weights++);
- cw[3] = *(cloth_weights++);
- cw += skip;
- }
- while (++i < num_verts);
-
- const U32 idx_count = mMesh->getNumFaces()*3;
-
- indicesp += mMesh->mFaceIndexOffset;
-
- U16* __restrict idx = indicesp.get();
- S32* __restrict src_idx = (S32*) mMesh->getFaces();
-
- i = 0;
-
- const S32 offset = (S32) mMesh->mFaceVertexOffset;
-
- do
+ for (S32 i = 0; i < mMesh->getNumFaces(); i++)
+ {
+ for (U32 j = 0; j < 3; j++)
{
- *(idx++) = *(src_idx++)+offset;
+ U32 k = i*3+j+mMesh->mFaceIndexOffset;
+ indicesp[k] = mMesh->getFaces()[i][j] + mMesh->mFaceVertexOffset;
}
- while (++i < idx_count);
}
}
}