diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index d9129181298197cdc2e5f40c4df60f938601c656..f13e6b7f43ff2e02d85f6166ec995fd3f55c3ba5 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 c6ac7af93cdd1dcc328aa066b9c220ac1468292c..dc3be24e3ac6c423894fd8ee2079cd9ad5672ea7 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 85da75510b120a726dae1a836847cf6bcc5f63c8..b7d8c470b5e0f12b53925cb4073aa1e9e2ade1a3 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -146,6 +146,7 @@ class LLViewerRegionImpl { 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 fefd4209aa71eaff8147700b85872fff5cdbcbb2..196f3636114dd763f907b3f60e5fba3cdf6b9ebc 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -347,6 +347,9 @@ class LLViewerRegion: public LLCapabilityProvider // implements this interface 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 @@ class LLViewerRegion: public LLCapabilityProvider // implements this interface void addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type); void decodeBoundingInfo(LLVOCacheEntry* entry); + bool isNonCacheableObjectCreated(U32 local_id); + public: struct CompareDistance {