summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-02-13 12:49:25 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-02-13 12:49:25 +0000
commitfb994141dae9ce4357bdc37217e92631aeb943e3 (patch)
tree896386c0a047bff47fb0830f7da163ded34aaff7 /indra
parentf0062fa41ae8849235a59808e28998d224a88b52 (diff)
parent827c1adc917d832b577b37e37b0eb3f26705c29d (diff)
resolve.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llflexibleobject.cpp15
-rw-r--r--indra/newview/llglsandbox.cpp24
-rw-r--r--indra/newview/llviewerobject.cpp3
-rw-r--r--indra/newview/llviewerobjectlist.cpp171
-rw-r--r--indra/newview/llviewerobjectlist.h31
-rw-r--r--indra/newview/llviewerwindow.cpp4
-rw-r--r--indra/newview/llvoclouds.cpp4
-rw-r--r--indra/newview/llvotextbubble.cpp3
-rw-r--r--indra/newview/llvovolume.cpp17
-rw-r--r--indra/newview/llworld.cpp3
-rw-r--r--indra/newview/pipeline.h5
11 files changed, 162 insertions, 118 deletions
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index aea2de8e92..561965d021 100644
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -51,6 +51,9 @@
/*static*/ F32 LLVolumeImplFlexible::sUpdateFactor = 1.0f;
+static LLFastTimer::DeclareTimer FTM_FLEXIBLE_REBUILD("Rebuild");
+static LLFastTimer::DeclareTimer FTM_DO_FLEXIBLE_UPDATE("Update");
+
// LLFlexibleObjectData::pack/unpack now in llprimitive.cpp
//-----------------------------------------------
@@ -194,7 +197,6 @@ void LLVolumeImplFlexible::remapSections(LLFlexibleObjectSection *source, S32 so
}
}
-
//-----------------------------------------------------------------------------
void LLVolumeImplFlexible::setAttributesOfAllSections(LLVector3* inScale)
{
@@ -363,6 +365,7 @@ inline S32 log2(S32 x)
void LLVolumeImplFlexible::doFlexibleUpdate()
{
+ LLFastTimer ftm(FTM_DO_FLEXIBLE_UPDATE);
LLVolume* volume = mVO->getVolume();
LLPath *path = &volume->getPath();
if (mSimulateRes == 0)
@@ -693,7 +696,10 @@ BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable)
}
volume->updateRelativeXform();
- doFlexibleUpdate();
+ {
+ LLFastTimer t(FTM_DO_FLEXIBLE_UPDATE);
+ doFlexibleUpdate();
+ }
// Object may have been rotated, which means it needs a rebuild. See SL-47220
BOOL rotated = FALSE;
@@ -710,7 +716,10 @@ BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable)
volume->regenFaces();
volume->mDrawable->setState(LLDrawable::REBUILD_VOLUME);
volume->dirtySpatialGroup();
- doFlexibleRebuild();
+ {
+ LLFastTimer t(FTM_FLEXIBLE_REBUILD);
+ doFlexibleRebuild();
+ }
volume->genBBoxes(isVolumeGlobal());
}
else if (!mUpdated || rotated)
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 750a9d478f..8569e208eb 100644
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -897,19 +897,21 @@ void LLViewerObjectList::renderObjectBeacons()
S32 last_line_width = -1;
// gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width)
- for (S32 i = 0; i < mDebugBeacons.count(); i++)
+ BOOL flush = FALSE;
+ for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter)
{
- const LLDebugBeacon &debug_beacon = mDebugBeacons[i];
+ const LLDebugBeacon &debug_beacon = *iter;
LLColor4 color = debug_beacon.mColor;
color.mV[3] *= 0.25f;
S32 line_width = debug_beacon.mLineWidth;
if (line_width != last_line_width)
{
- if (i > 0)
+ if (flush)
{
gGL.end();
- gGL.flush();
}
+ flush = TRUE;
+ gGL.flush();
glLineWidth( (F32)line_width );
last_line_width = line_width;
gGL.begin(LLRender::LINES);
@@ -936,18 +938,20 @@ void LLViewerObjectList::renderObjectBeacons()
S32 last_line_width = -1;
// gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width)
- for (S32 i = 0; i < mDebugBeacons.count(); i++)
+ BOOL flush = FALSE;
+ for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter)
{
- const LLDebugBeacon &debug_beacon = mDebugBeacons[i];
+ const LLDebugBeacon &debug_beacon = *iter;
S32 line_width = debug_beacon.mLineWidth;
if (line_width != last_line_width)
{
- if (i > 0)
+ if (flush)
{
gGL.end();
- gGL.flush();
}
+ flush = TRUE;
+ gGL.flush();
glLineWidth( (F32)line_width );
last_line_width = line_width;
gGL.begin(LLRender::LINES);
@@ -969,9 +973,9 @@ void LLViewerObjectList::renderObjectBeacons()
gGL.flush();
glLineWidth(1.f);
- for (S32 i = 0; i < mDebugBeacons.count(); i++)
+ for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter)
{
- LLDebugBeacon &debug_beacon = mDebugBeacons[i];
+ LLDebugBeacon &debug_beacon = *iter;
if (debug_beacon.mString == "")
{
continue;
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index d0afa9d9de..b5642d07a5 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -2001,6 +2001,9 @@ BOOL LLViewerObject::isActive() const
BOOL LLViewerObject::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
{
+ static LLFastTimer::DeclareTimer ftm("Viewer Object");
+ LLFastTimer t(ftm);
+
if (mDead)
{
// It's dead. Don't update it.
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 7a6f479685..7f147836a1 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -93,7 +93,7 @@ extern LLPipeline gPipeline;
// Statics for object lookup tables.
U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check.
-LLMap<U64, U32> LLViewerObjectList::sIPAndPortToIndex;
+std::map<U64, U32> LLViewerObjectList::sIPAndPortToIndex;
std::map<U64, LLUUID> LLViewerObjectList::sIndexAndLocalIDToUUID;
LLViewerObjectList::LLViewerObjectList()
@@ -571,10 +571,9 @@ void LLViewerObjectList::processCachedObjectUpdate(LLMessageSystem *mesgsys,
void LLViewerObjectList::dirtyAllObjectInventory()
{
- S32 count = mObjects.count();
- for(S32 i = 0; i < count; ++i)
+ for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)
{
- mObjects[i]->dirtyInventory();
+ (*iter)->dirtyInventory();
}
}
@@ -587,14 +586,14 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent)
S32 num_updates, max_value;
if (NUM_BINS - 1 == mCurBin)
{
- num_updates = mObjects.count() - mCurLazyUpdateIndex;
- max_value = mObjects.count();
+ num_updates = (S32) mObjects.size() - mCurLazyUpdateIndex;
+ max_value = (S32) mObjects.size();
gTextureList.setUpdateStats(TRUE);
}
else
{
- num_updates = (mObjects.count() / NUM_BINS) + 1;
- max_value = llmin(mObjects.count(), mCurLazyUpdateIndex + num_updates);
+ num_updates = ((S32) mObjects.size() / NUM_BINS) + 1;
+ max_value = llmin((S32) mObjects.size(), mCurLazyUpdateIndex + num_updates);
}
@@ -647,7 +646,7 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent)
}
mCurLazyUpdateIndex = max_value;
- if (mCurLazyUpdateIndex == mObjects.count())
+ if (mCurLazyUpdateIndex == mObjects.size())
{
mCurLazyUpdateIndex = 0;
}
@@ -694,20 +693,26 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
// Make a copy of the list in case something in idleUpdate() messes with it
std::vector<LLViewerObject*> idle_list;
- idle_list.reserve( mActiveObjects.size() );
+
+ static LLFastTimer::DeclareTimer idle_copy("Idle Copy");
- for (std::set<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin();
- active_iter != mActiveObjects.end(); active_iter++)
{
- objectp = *active_iter;
- if (objectp)
+ LLFastTimer t(idle_copy);
+ idle_list.reserve( mActiveObjects.size() );
+
+ for (std::set<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin();
+ active_iter != mActiveObjects.end(); active_iter++)
{
- idle_list.push_back( objectp );
- }
- else
- { // There shouldn't be any NULL pointers in the list, but they have caused
- // crashes before. This may be idleUpdate() messing with the list.
- llwarns << "LLViewerObjectList::update has a NULL objectp" << llendl;
+ objectp = *active_iter;
+ if (objectp)
+ {
+ idle_list.push_back( objectp );
+ }
+ else
+ { // There shouldn't be any NULL pointers in the list, but they have caused
+ // crashes before. This may be idleUpdate() messing with the list.
+ llwarns << "LLViewerObjectList::update has a NULL objectp" << llendl;
+ }
}
}
@@ -807,7 +812,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
}
*/
- LLViewerStats::getInstance()->mNumObjectsStat.addValue(mObjects.count());
+ LLViewerStats::getInstance()->mNumObjectsStat.addValue((S32) mObjects.size());
LLViewerStats::getInstance()->mNumActiveObjectsStat.addValue(num_active_objects);
LLViewerStats::getInstance()->mNumSizeCulledStat.addValue(mNumSizeCulled);
LLViewerStats::getInstance()->mNumVisCulledStat.addValue(mNumVisCulled);
@@ -815,9 +820,9 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
void LLViewerObjectList::clearDebugText()
{
- for (S32 i = 0; i < mObjects.count(); i++)
+ for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)
{
- mObjects[i]->setDebugText("");
+ (*iter)->setDebugText("");
}
}
@@ -856,7 +861,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
if (objectp->isOnMap())
{
- mMapObjects.removeObj(objectp);
+ removeFromMap(objectp);
}
// Don't clean up mObject references, these will be cleaned up more efficiently later!
@@ -917,10 +922,10 @@ void LLViewerObjectList::killObjects(LLViewerRegion *regionp)
{
LLViewerObject *objectp;
- S32 i;
- for (i = 0; i < mObjects.count(); i++)
+
+ for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)
{
- objectp = mObjects[i];
+ objectp = *iter;
if (objectp->mRegionp == regionp)
{
@@ -937,10 +942,9 @@ void LLViewerObjectList::killAllObjects()
// Used only on global destruction.
LLViewerObject *objectp;
- for (S32 i = 0; i < mObjects.count(); i++)
+ for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)
{
- objectp = mObjects[i];
-
+ objectp = *iter;
killObject(objectp);
llassert(objectp->isDead());
}
@@ -949,7 +953,7 @@ void LLViewerObjectList::killAllObjects()
if(!mObjects.empty())
{
- llwarns << "LLViewerObjectList::killAllObjects still has entries in mObjects: " << mObjects.count() << llendl;
+ llwarns << "LLViewerObjectList::killAllObjects still has entries in mObjects: " << mObjects.size() << llendl;
mObjects.clear();
}
@@ -974,16 +978,15 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer)
return;
}
- S32 i = 0;
S32 num_removed = 0;
LLViewerObject *objectp;
- while (i < mObjects.count())
+ for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); )
{
// Scan for all of the dead objects and remove any "global" references to them.
- objectp = mObjects[i];
+ objectp = *iter;
if (objectp->isDead())
{
- mObjects.remove(i);
+ iter = mObjects.erase(iter);
num_removed++;
if (num_removed == mNumDeadObjects)
@@ -994,8 +997,7 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer)
}
else
{
- // iterate, this isn't a dead object.
- i++;
+ ++iter;
}
}
@@ -1045,12 +1047,11 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
}
LLViewerObject *objectp;
- S32 i;
- for (i = 0; i < mObjects.count(); i++)
+ for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)
{
- objectp = getObject(i);
+ objectp = *iter;
// There could be dead objects on the object list, so don't update stuff if the object is dead.
- if (objectp)
+ if (!objectp->isDead())
{
objectp->updatePositionCaches();
@@ -1080,9 +1081,9 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
F32 max_radius = gSavedSettings.getF32("MiniMapPrimMaxRadius");
- for (S32 i = 0; i < mMapObjects.count(); i++)
+ for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter)
{
- LLViewerObject* objectp = mMapObjects[i];
+ LLViewerObject* objectp = *iter;
if (!objectp->getRegion() || objectp->isOrphaned() || objectp->isAttachment())
{
continue;
@@ -1148,21 +1149,14 @@ void LLViewerObjectList::renderObjectBounds(const LLVector3 &center)
{
}
-void LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, const LLRect& screen_rect, BOOL pick_parcel_wall, BOOL render_transparent)
-{
- generatePickList(camera);
- renderPickList(screen_rect, pick_parcel_wall, render_transparent);
-}
-
void LLViewerObjectList::generatePickList(LLCamera &camera)
{
LLViewerObject *objectp;
S32 i;
// Reset all of the GL names to zero.
- for (i = 0; i < mObjects.count(); i++)
+ for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)
{
- objectp = mObjects[i];
- objectp->mGLName = 0;
+ (*iter)->mGLName = 0;
}
mSelectPickList.clear();
@@ -1325,17 +1319,19 @@ void LLViewerObjectList::addDebugBeacon(const LLVector3 &pos_agent,
const LLColor4 &text_color,
S32 line_width)
{
- LLDebugBeacon *beaconp = mDebugBeacons.reserve_block(1);
- beaconp->mPositionAgent = pos_agent;
- beaconp->mString = string;
- beaconp->mColor = color;
- beaconp->mTextColor = text_color;
- beaconp->mLineWidth = line_width;
+ LLDebugBeacon beacon;
+ beacon.mPositionAgent = pos_agent;
+ beacon.mString = string;
+ beacon.mColor = color;
+ beacon.mTextColor = text_color;
+ beacon.mLineWidth = line_width;
+
+ mDebugBeacons.push_back(beacon);
}
void LLViewerObjectList::resetObjectBeacons()
{
- mDebugBeacons.reset();
+ mDebugBeacons.clear();
}
LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLViewerRegion *regionp)
@@ -1353,7 +1349,7 @@ LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLVi
mUUIDObjectMap[fullid] = objectp;
- mObjects.put(objectp);
+ mObjects.push_back(objectp);
updateActive(objectp);
@@ -1392,7 +1388,7 @@ LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRe
gMessageSystem->getSenderIP(),
gMessageSystem->getSenderPort());
- mObjects.put(objectp);
+ mObjects.push_back(objectp);
updateActive(objectp);
@@ -1415,11 +1411,11 @@ LLViewerObject *LLViewerObjectList::replaceObject(const LLUUID &id, const LLPCod
S32 LLViewerObjectList::findReferences(LLDrawable *drawablep) const
{
LLViewerObject *objectp;
- S32 i;
S32 num_refs = 0;
- for (i = 0; i < mObjects.count(); i++)
+
+ for (vobj_list_t::const_iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)
{
- objectp = mObjects[i];
+ objectp = *iter;
if (objectp->mDrawable.notNull())
{
num_refs += objectp->mDrawable->findReferences(drawablep);
@@ -1464,15 +1460,15 @@ void LLViewerObjectList::orphanize(LLViewerObject *childp, U32 parent_id, U32 ip
// Unknown parent, add to orpaned child list
U64 parent_info = getIndex(parent_id, ip, port);
- if (-1 == mOrphanParents.find(parent_info))
+ if (std::find(mOrphanParents.begin(), mOrphanParents.end(), parent_info) == mOrphanParents.end())
{
- mOrphanParents.put(parent_info);
+ mOrphanParents.push_back(parent_info);
}
LLViewerObjectList::OrphanInfo oi(parent_info, childp->mID);
- if (-1 == mOrphanChildren.find(oi))
+ if (std::find(mOrphanChildren.begin(), mOrphanChildren.end(), oi) == mOrphanChildren.end())
{
- mOrphanChildren.put(oi);
+ mOrphanChildren.push_back(oi);
mNumOrphans++;
}
}
@@ -1495,28 +1491,29 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
// See if we are a parent of an orphan.
// Note: This code is fairly inefficient but it should happen very rarely.
// It can be sped up if this is somehow a performance issue...
- if (0 == mOrphanParents.count())
+ if (mOrphanParents.empty())
{
// no known orphan parents
return;
}
- if (-1 == mOrphanParents.find(getIndex(objectp->mLocalID, ip, port)))
+ if (std::find(mOrphanParents.begin(), mOrphanParents.end(), getIndex(objectp->mLocalID, ip, port)) == mOrphanParents.end())
{
// did not find objectp in OrphanParent list
return;
}
- S32 i;
U64 parent_info = getIndex(objectp->mLocalID, ip, port);
BOOL orphans_found = FALSE;
// Iterate through the orphan list, and set parents of matching children.
- for (i = 0; i < mOrphanChildren.count(); i++)
- {
- if (mOrphanChildren[i].mParentInfo != parent_info)
+
+ for (std::vector<OrphanInfo>::iterator iter = mOrphanChildren.begin(); iter != mOrphanChildren.end(); )
+ {
+ if (iter->mParentInfo != parent_info)
{
+ ++iter;
continue;
}
- LLViewerObject *childp = findObject(mOrphanChildren[i].mChildInfo);
+ LLViewerObject *childp = findObject(iter->mChildInfo);
if (childp)
{
if (childp == objectp)
@@ -1550,29 +1547,35 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
objectp->addChild(childp);
orphans_found = TRUE;
+ ++iter;
}
else
{
llinfos << "Missing orphan child, removing from list" << llendl;
- mOrphanChildren.remove(i);
- i--;
+
+ iter = mOrphanChildren.erase(iter);
}
}
// Remove orphan parent and children from lists now that they've been found
- mOrphanParents.remove(mOrphanParents.find(parent_info));
-
- i = 0;
- while (i < mOrphanChildren.count())
{
- if (mOrphanChildren[i].mParentInfo == parent_info)
+ std::vector<U64>::iterator iter = std::find(mOrphanParents.begin(), mOrphanParents.end(), parent_info);
+ if (iter != mOrphanParents.end())
+ {
+ mOrphanParents.erase(iter);
+ }
+ }
+
+ for (std::vector<OrphanInfo>::iterator iter = mOrphanChildren.begin(); iter != mOrphanChildren.end(); )
+ {
+ if (iter->mParentInfo == parent_info)
{
- mOrphanChildren.remove(i);
+ iter = mOrphanChildren.erase(iter);
mNumOrphans--;
}
else
{
- i++;
+ ++iter;
}
}
diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h
index 2858081dc9..706966deae 100644
--- a/indra/newview/llviewerobjectlist.h
+++ b/indra/newview/llviewerobjectlist.h
@@ -38,8 +38,6 @@
// common includes
#include "llstat.h"
-#include "lldarrayptr.h"
-#include "llmap.h" // *TODO: switch to std::map
#include "llstring.h"
// project includes
@@ -50,7 +48,7 @@ class LLNetMap;
class LLDebugBeacon;
const U32 CLOSE_BIN_SIZE = 10;
-const U32 NUM_BINS = 16;
+const U32 NUM_BINS = 128;
// GL name = position in object list + GL_NAME_INDEX_OFFSET so that
// we can have special numbers like zero.
@@ -111,13 +109,12 @@ public:
void updateAvatarVisibility();
// Selection related stuff
- void renderObjectsForSelect(LLCamera &camera, const LLRect& screen_rect, BOOL pick_parcel_wall = FALSE, BOOL render_transparent = TRUE);
void generatePickList(LLCamera &camera);
void renderPickList(const LLRect& screen_rect, BOOL pick_parcel_wall, BOOL render_transparent);
LLViewerObject *getSelectedObject(const U32 object_id);
- inline S32 getNumObjects() { return mObjects.count(); }
+ inline S32 getNumObjects() { return (S32) mObjects.size(); }
void addToMap(LLViewerObject *objectp);
void removeFromMap(LLViewerObject *objectp);
@@ -131,7 +128,7 @@ public:
S32 findReferences(LLDrawable *drawablep) const; // Find references to drawable in all objects, and return value.
- S32 getOrphanParentCount() const { return mOrphanParents.count(); }
+ S32 getOrphanParentCount() const { return (S32) mOrphanParents.size(); }
S32 getOrphanCount() const { return mNumOrphans; }
void orphanize(LLViewerObject *childp, U32 parent_id, U32 ip, U32 port);
void findOrphans(LLViewerObject* objectp, U32 ip, U32 port);
@@ -179,26 +176,28 @@ public:
S32 mNumUnknownKills;
S32 mNumDeadObjects;
protected:
- LLDynamicArray<U64> mOrphanParents; // LocalID/ip,port of orphaned objects
- LLDynamicArray<OrphanInfo> mOrphanChildren; // UUID's of orphaned objects
+ std::vector<U64> mOrphanParents; // LocalID/ip,port of orphaned objects
+ std::vector<OrphanInfo> mOrphanChildren; // UUID's of orphaned objects
S32 mNumOrphans;
- LLDynamicArrayPtr<LLPointer<LLViewerObject>, 256> mObjects;
+ typedef std::vector<LLPointer<LLViewerObject> > vobj_list_t;
+
+ vobj_list_t mObjects;
std::set<LLPointer<LLViewerObject> > mActiveObjects;
- LLDynamicArrayPtr<LLPointer<LLViewerObject> > mMapObjects;
+ vobj_list_t mMapObjects;
typedef std::map<LLUUID, LLPointer<LLViewerObject> > vo_map;
vo_map mDeadObjects; // Need to keep multiple entries per UUID
std::map<LLUUID, LLPointer<LLViewerObject> > mUUIDObjectMap;
- LLDynamicArray<LLDebugBeacon> mDebugBeacons;
+ std::vector<LLDebugBeacon> mDebugBeacons;
S32 mCurLazyUpdateIndex;
static U32 sSimulatorMachineIndex;
- static LLMap<U64, U32> sIPAndPortToIndex;
+ static std::map<U64, U32> sIPAndPortToIndex;
static std::map<U64, LLUUID> sIndexAndLocalIDToUUID;
@@ -264,12 +263,16 @@ inline LLViewerObject *LLViewerObjectList::getObject(const S32 index)
inline void LLViewerObjectList::addToMap(LLViewerObject *objectp)
{
- mMapObjects.put(objectp);
+ mMapObjects.push_back(objectp);
}
inline void LLViewerObjectList::removeFromMap(LLViewerObject *objectp)
{
- mMapObjects.removeObj(objectp);
+ std::vector<LLPointer<LLViewerObject> >::iterator iter = std::find(mMapObjects.begin(), mMapObjects.end(), objectp);
+ if (iter != mMapObjects.end())
+ {
+ mMapObjects.erase(iter);
+ }
}
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 05096b6bbc..3b73d6aeaa 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2476,6 +2476,9 @@ void append_xui_tooltip(LLView* viewp, LLToolTip::Params& params)
// event processing.
void LLViewerWindow::updateUI()
{
+ static LLFastTimer::DeclareTimer ftm("Update UI");
+ LLFastTimer t(ftm);
+
static std::string last_handle_msg;
LLConsole::updateClass();
@@ -3057,7 +3060,6 @@ void LLViewerWindow::saveLastMouse(const LLCoordGL &point)
// Must be called after displayObjects is called, which sets the mGLName parameter
// NOTE: This function gets called 3 times:
// render_ui_3d: FALSE, FALSE, TRUE
-// renderObjectsForSelect: TRUE, pick_parcel_wall, FALSE
// render_hud_elements: FALSE, FALSE, FALSE
void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, BOOL for_hud )
{
diff --git a/indra/newview/llvoclouds.cpp b/indra/newview/llvoclouds.cpp
index 177cb16c50..5153cef709 100644
--- a/indra/newview/llvoclouds.cpp
+++ b/indra/newview/llvoclouds.cpp
@@ -77,9 +77,11 @@ BOOL LLVOClouds::isActive() const
return TRUE;
}
-
BOOL LLVOClouds::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
{
+ static LLFastTimer::DeclareTimer ftm("Idle Clouds");
+ LLFastTimer t(ftm);
+
if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS)))
{
return TRUE;
diff --git a/indra/newview/llvotextbubble.cpp b/indra/newview/llvotextbubble.cpp
index 75beab519e..428ef20006 100644
--- a/indra/newview/llvotextbubble.cpp
+++ b/indra/newview/llvotextbubble.cpp
@@ -84,6 +84,9 @@ BOOL LLVOTextBubble::isActive() const
BOOL LLVOTextBubble::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
{
+ static LLFastTimer::DeclareTimer ftm("Text Bubble");
+ LLFastTimer t(ftm);
+
F32 dt = mUpdateTimer.getElapsedTimeF32();
// Die after a few seconds.
if (dt > 1.5f)
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 4f0f3f3c45..e95c7f411c 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -613,6 +613,9 @@ BOOL LLVOVolume::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
{
LLViewerObject::idleUpdate(agent, world, time);
+ static LLFastTimer::DeclareTimer ftm("Volume");
+ LLFastTimer t(ftm);
+
if (mDead || mDrawable.isNull())
{
return TRUE;
@@ -634,6 +637,18 @@ BOOL LLVOVolume::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
mVolumeImpl->doIdleUpdate(agent, world, time);
}
+ const S32 MAX_ACTIVE_OBJECT_QUIET_FRAMES = 40;
+
+ if (mDrawable->isActive())
+ {
+ if (mDrawable->isRoot() &&
+ mDrawable->mQuietCount++ > MAX_ACTIVE_OBJECT_QUIET_FRAMES &&
+ (!mDrawable->getParent() || !mDrawable->getParent()->isActive()))
+ {
+ mDrawable->makeStatic();
+ }
+ }
+
return TRUE;
}
@@ -1134,7 +1149,7 @@ BOOL LLVOVolume::calcLOD()
S32 cur_detail = 0;
F32 radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length();
- F32 distance = llmin(mDrawable->mDistanceWRTCamera, MAX_LOD_DISTANCE);
+ F32 distance = mDrawable->mDistanceWRTCamera; //llmin(mDrawable->mDistanceWRTCamera, MAX_LOD_DISTANCE);
distance *= sDistanceFactor;
F32 rampDist = LLVOVolume::sLODFactor * 2;
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index feab6d126b..f01e30f9da 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -657,6 +657,9 @@ void LLWorld::updateParticles()
void LLWorld::updateClouds(const F32 dt)
{
+ static LLFastTimer::DeclareTimer ftm("World Clouds");
+ LLFastTimer t(ftm);
+
if (gSavedSettings.getBOOL("FreezeTime") ||
!gSavedSettings.getBOOL("SkyUseClassicClouds"))
{
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index e6dfb90327..c61274bfb1 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -272,8 +272,7 @@ public:
void shiftObjects(const LLVector3 &offset);
void setLight(LLDrawable *drawablep, BOOL is_light);
- void setActive(LLDrawable *drawablep, BOOL active);
-
+
BOOL hasRenderBatches(const U32 type) const;
LLCullResult::drawinfo_list_t::iterator beginRenderMap(U32 type);
LLCullResult::drawinfo_list_t::iterator endRenderMap(U32 type);
@@ -591,8 +590,6 @@ protected:
LLViewerObject::vobj_list_t mCreateQ;
- LLDrawable::drawable_set_t mActiveQ;
-
LLDrawable::drawable_set_t mRetexturedList;
class HighlightItem