JointMesh face update optimization

This commit is contained in:
Shyotl
2011-03-15 05:13:06 -05:00
parent 1c33889762
commit 387e8ed756
6 changed files with 122 additions and 32 deletions

View File

@@ -2484,6 +2484,8 @@ void LLVOAvatar::updateMeshData()
// resize immediately
facep->setSize(num_vertices, num_indices);
bool terse_update = false;
if(facep->mVertexBuffer.isNull())
{
facep->mVertexBuffer = new LLVertexBufferAvatar();
@@ -2491,7 +2493,15 @@ void LLVOAvatar::updateMeshData()
}
else
{
facep->mVertexBuffer->resizeBuffer(num_vertices, num_indices) ;
if (facep->mVertexBuffer->getRequestedIndices() == num_indices &&
facep->mVertexBuffer->getRequestedVerts() == num_vertices)
{
terse_update = true;
}
else
{
facep->mVertexBuffer->resizeBuffer(num_vertices, num_indices) ;
}
}
facep->setGeomIndex(0);
@@ -2506,7 +2516,7 @@ void LLVOAvatar::updateMeshData()
for(S32 k = j ; k < part_index ; k++)
{
mMeshLOD[k]->updateFaceData(facep, mAdjustedPixelArea, k == MESH_ID_HAIR);
mMeshLOD[k]->updateFaceData(facep, mAdjustedPixelArea, k == MESH_ID_HAIR, terse_update);
}
stop_glerror();