summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rwxr-xr-xindra/newview/llviewerregion.cpp62
1 files changed, 52 insertions, 10 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 781a754b7c..55137168ee 100755
--- 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?
@@ -236,7 +237,7 @@ public:
}
}
- void result(const LLSD& content)
+ void result(const LLSD& content)
{
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
if(!regionp) //region was removed
@@ -1742,7 +1743,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);
@@ -1783,8 +1786,17 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry)
//2, parent is not in the cache, put into the orphan list.
if(!parent)
{
+ //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
{
if(!parent->isState(LLVOCacheEntry::INACTIVE))
@@ -1844,7 +1856,7 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLDataPackerB
LLViewerObject::unpackU32(&dp, crc, "CRC");
LLVOCacheEntry* entry = getCacheEntry(local_id);
-
+
if (entry)
{
// we've seen this object before
@@ -1858,7 +1870,7 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLDataPackerB
{
// Update the cache entry
LLPointer<LLVOCacheEntry> new_entry = new LLVOCacheEntry(local_id, crc, dp);
-
+
//if visible, update it
if(!entry->isState(LLVOCacheEntry::INACTIVE))
{
@@ -1903,7 +1915,7 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObjec
{
return result;
}
-
+
if(objectp->mDrawable.notNull() && !entry->getEntry())
{
entry->setOctreeEntry(objectp->mDrawable->getEntry());
@@ -1949,6 +1961,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)
@@ -2012,7 +2054,7 @@ void LLViewerRegion::requestCacheMisses()
LLMessageSystem* msg = gMessageSystem;
BOOL start_new_message = TRUE;
S32 blocks = 0;
-
+
//send requests for all cache-missed objects
for (CacheMissItem::cache_miss_list_t::iterator iter = mCacheMissList.begin(); iter != mCacheMissList.end(); ++iter)
{
@@ -2042,7 +2084,7 @@ void LLViewerRegion::requestCacheMisses()
if (!start_new_message)
{
sendReliableMessage();
- }
+ }
mCacheDirty = TRUE ;
// llinfos << "KILLDEBUG Sent cache miss full " << full_count << " crc " << crc_count << llendl;
@@ -2277,7 +2319,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("LandResources");
capabilityNames.append("MapLayer");
capabilityNames.append("MapLayerGod");
- capabilityNames.append("MeshUploadFlag");
+ capabilityNames.append("MeshUploadFlag");
capabilityNames.append("NavMeshGenerationStatus");
capabilityNames.append("NewFileAgentInventory");
capabilityNames.append("ObjectMedia");
@@ -2317,7 +2359,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("ViewerMetrics");
capabilityNames.append("ViewerStartAuction");
capabilityNames.append("ViewerStats");
-
+
// Please add new capabilities alphabetically to reduce
// merge conflicts.
}
@@ -2326,7 +2368,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
{
if (getCapability("Seed") == url)
{
- //llwarns << "Ignoring duplicate seed capability" << llendl;
+ // llwarns << "Ignoring duplicate seed capability" << llendl;
//Instead of just returning we build up a second set of seed caps and compare them
//to the "original" seed cap received and determine why there is problem!
LLSD capabilityNames = LLSD::emptyArray();