only cache mesh if meshing was successful

re-enable sculpt mesh caching
prioritization
dahlia 2009-10-04 20:01:44 -07:00
parent a208f33c5d
commit 5c593f3892
1 changed files with 4 additions and 8 deletions

View File

@ -498,12 +498,9 @@ namespace OpenSim.Region.Physics.Meshing
// If this mesh has been created already, return it instead of creating another copy
// For large regions with 100k+ prims and hundreds of copies of each, this can save a GB or more of memory
if (! primShape.SculptEntry)
{
key = GetMeshKey(primShape, size, lod);
if (m_uniqueMeshes.TryGetValue(key, out mesh))
return mesh;
}
key = GetMeshKey(primShape, size, lod);
if (m_uniqueMeshes.TryGetValue(key, out mesh))
return mesh;
if (size.X < 0.01f) size.X = 0.01f;
if (size.Y < 0.01f) size.Y = 0.01f;
@ -525,10 +522,9 @@ namespace OpenSim.Region.Physics.Meshing
// trim the vertex and triangle lists to free up memory
mesh.TrimExcess();
}
if (!primShape.SculptEntry)
m_uniqueMeshes.Add(key, mesh);
}
return mesh;
}