diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2013-06-05 18:01:25 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2013-06-05 18:01:25 -0600 |
commit | a6dbd8e089b7d0f462a8ed753258a442b1861541 (patch) | |
tree | ccba4ba44617b6b40dd4dde6c69400c107a2e0a8 | |
parent | f6c5a4057d1154e590ee630cb8254879a1f426e4 (diff) |
fix for SH-4227: interesting: long delay between root and child prim loading.
-rw-r--r-- | indra/newview/llviewerobject.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llviewerobjectlist.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewerregion.cpp | 46 | ||||
-rw-r--r-- | indra/newview/llviewerregion.h | 5 |
4 files changed, 80 insertions, 3 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index d912918129..f13e6b7f43 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -343,6 +343,10 @@ void LLViewerObject::markDead() // Mark itself as dead mDead = TRUE; + if(mRegionp) + { + mRegionp->removeFromCreatedList(getLocalID()); + } gObjectList.cleanupReferences(this); LLViewerObject *childp; @@ -1046,6 +1050,17 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, } else { + if(regionp != mRegionp) + { + if(mRegionp) + { + mRegionp->removeFromCreatedList(getLocalID()); + } + if(regionp) + { + regionp->addToCreatedList(getLocalID()); + } + } mRegionp = regionp ; } } @@ -5454,7 +5469,18 @@ void LLViewerObject::setRegion(LLViewerRegion *regionp) { llwarns << "viewer object set region to NULL" << llendl; } - + if(regionp != mRegionp) + { + if(mRegionp) + { + mRegionp->removeFromCreatedList(getLocalID()); + } + if(regionp) + { + regionp->addToCreatedList(getLocalID()); + } + } + mLatestRecvPacketID = 0; mRegionp = regionp; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index c6ac7af93c..dc3be24e3a 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -2045,6 +2045,10 @@ LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRe // llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << llendl; return NULL; } + if(regionp) + { + regionp->addToCreatedList(local_id); + } mUUIDObjectMap[fullid] = objectp; setUUIDAndLocal(fullid, diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 85da75510b..b7d8c470b5 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -146,6 +146,7 @@ public: LLVOCachePartition* mVOCachePartition; LLVOCacheEntry::vocache_entry_set_t mVisibleEntries; //must-be-created visible entries wait for objects creation. LLVOCacheEntry::vocache_entry_priority_list_t mWaitingList; //transient list storing sorted visible entries waiting for object creation. + std::set<U32> mNonCacheableCreatedList; //list of local ids of all non-cacheable objects // time? // LRU info? @@ -1694,7 +1695,9 @@ void LLViewerRegion::findOrphans(U32 parent_id) std::vector<U32>* children = &mOrphanMap[parent_id]; for(S32 i = 0; i < children->size(); i++) { - forceToRemoveFromCache((*children)[i], NULL); + //parent is visible, so is the child. + LLVOCacheEntry* child = getCacheEntry((*children)[i]); + addVisibleCacheEntry(child); } children->clear(); mOrphanMap.erase(parent_id); @@ -1735,7 +1738,16 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry) //2, parent is not in the cache, put into the orphan list. if(!parent) { - mOrphanMap[parent_id].push_back(entry->getLocalID()); + //check if parent is non-cacheable and already created + if(isNonCacheableObjectCreated(parent_id)) + { + //parent is visible, so is the child. + addVisibleCacheEntry(entry); + } + else + { + mOrphanMap[parent_id].push_back(entry->getLocalID()); + } } else //parent in cache { @@ -1901,6 +1913,36 @@ void LLViewerRegion::addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_ty #endif } +//check if a non-cacheable object is already created. +bool LLViewerRegion::isNonCacheableObjectCreated(U32 local_id) +{ + if(mImpl && local_id > 0 && mImpl->mNonCacheableCreatedList.find(local_id) != mImpl->mNonCacheableCreatedList.end()) + { + return true; + } + return false; +} + +void LLViewerRegion::removeFromCreatedList(U32 local_id) +{ + if(mImpl && local_id > 0) + { + std::set<U32>::iterator iter = mImpl->mNonCacheableCreatedList.find(local_id); + if(iter != mImpl->mNonCacheableCreatedList.end()) + { + mImpl->mNonCacheableCreatedList.erase(iter); + } + } +} + +void LLViewerRegion::addToCreatedList(U32 local_id) +{ + if(mImpl && local_id > 0) + { + mImpl->mNonCacheableCreatedList.insert(local_id); + } +} + // Get data packer for this object, if we have cached data // AND the CRC matches. JC bool LLViewerRegion::probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss_type) diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index fefd4209aa..196f363611 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -347,6 +347,9 @@ public: void getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegions ); void getNeighboringRegionsStatus( std::vector<S32>& regions ); + void removeFromCreatedList(U32 local_id); + void addToCreatedList(U32 local_id); + private: void addToVOCacheTree(LLVOCacheEntry* entry); LLViewerObject* addNewObject(LLVOCacheEntry* entry); @@ -361,6 +364,8 @@ private: void addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type); void decodeBoundingInfo(LLVOCacheEntry* entry); + bool isNonCacheableObjectCreated(U32 local_id); + public: struct CompareDistance { |