diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llviewerobject.cpp | 52 | ||||
-rwxr-xr-x | indra/newview/llviewerobjectlist.cpp | 20 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 62 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.h | 13 |
4 files changed, 112 insertions, 35 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 9e6d8e78d1..9de55f96f0 100755 --- 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 ; } } @@ -2904,25 +2919,25 @@ void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code, LLExtS if (object->loadTaskInvFile(ft->mFilename)) { - LLInventoryObject::object_list_t::iterator it = object->mInventory->begin(); - LLInventoryObject::object_list_t::iterator end = object->mInventory->end(); - std::list<LLUUID>& pending_lst = object->mPendingInventoryItemsIDs; + LLInventoryObject::object_list_t::iterator it = object->mInventory->begin(); + LLInventoryObject::object_list_t::iterator end = object->mInventory->end(); + std::list<LLUUID>& pending_lst = object->mPendingInventoryItemsIDs; - for (; it != end && pending_lst.size(); ++it) + for (; it != end && pending_lst.size(); ++it) + { + LLViewerInventoryItem* item = dynamic_cast<LLViewerInventoryItem*>(it->get()); + if(item && item->getType() != LLAssetType::AT_CATEGORY) { - LLViewerInventoryItem* item = dynamic_cast<LLViewerInventoryItem*>(it->get()); - if(item && item->getType() != LLAssetType::AT_CATEGORY) + std::list<LLUUID>::iterator id_it = std::find(pending_lst.begin(), pending_lst.begin(), item->getAssetUUID()); + if (id_it != pending_lst.end()) { - std::list<LLUUID>::iterator id_it = std::find(pending_lst.begin(), pending_lst.begin(), item->getAssetUUID()); - if (id_it != pending_lst.end()) - { - pending_lst.erase(id_it); - } + pending_lst.erase(id_it); } } } - else - { + } + else + { // MAINT-2597 - crash when trying to edit a no-mod object // Somehow get an contents inventory response, but with an invalid stream (possibly 0 size?) // Stated repro was specific to no-mod objects so failing without user interaction should be safe. @@ -5469,6 +5484,17 @@ 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 546a7acfc6..83ebfc2ec3 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -456,8 +456,8 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (compressed) { S32 uncompressed_length = 2048; - compressed_dp.reset(); - + compressed_dp.reset(); + uncompressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data); mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, compressed_dpbuffer, 0, i); compressed_dp.assignBuffer(compressed_dpbuffer, uncompressed_length); @@ -519,7 +519,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, // llinfos << "Full Update, obj " << local_id << ", global ID" << fullid << "from " << mesgsys->getSender() << llendl; } objectp = findObject(fullid); - + if(remove_from_cache) { objectp = regionp->forceToRemoveFromCache(local_id, objectp); @@ -1024,10 +1024,10 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) static std::vector<LLViewerObject*> idle_list; U32 idle_count = 0; - + { LLFastTimer t(FTM_IDLE_COPY); - + for (std::vector<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin(); active_iter != mActiveObjects.end(); active_iter++) { @@ -1055,7 +1055,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) std::vector<LLViewerObject*>::iterator idle_end = idle_list.begin()+idle_count; if (gSavedSettings.getBOOL("FreezeTime")) - { + { for (std::vector<LLViewerObject*>::iterator iter = idle_list.begin(); iter != idle_end; iter++) @@ -1076,14 +1076,14 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) llassert(objectp->isActive()); objectp->idleUpdate(agent, world, frame_time); - } + } //update flexible objects LLVolumeImplFlexible::updateClass(); //update animated textures LLViewerTextureAnim::updateClass(); - } + } @@ -2048,6 +2048,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 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(); diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index b39bac62bc..f3c4c080c1 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -86,7 +86,7 @@ public: PARTITION_GRASS, PARTITION_VOLUME, PARTITION_BRIDGE, - PARTITION_HUD_PARTICLE, + PARTITION_HUD_PARTICLE, PARTITION_VO_CACHE, PARTITION_NONE, NUM_PARTITIONS @@ -359,6 +359,9 @@ public: const LLViewerRegionImpl * getRegionImpl() const { return mImpl; } LLViewerRegionImpl * getRegionImplNC() { return mImpl; } + void removeFromCreatedList(U32 local_id); + void addToCreatedList(U32 local_id); + private: void addToVOCacheTree(LLVOCacheEntry* entry); LLViewerObject* addNewObject(LLVOCacheEntry* entry); @@ -373,6 +376,8 @@ private: void addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type); void decodeBoundingInfo(LLVOCacheEntry* entry); + bool isNonCacheableObjectCreated(U32 local_id); + public: struct CompareDistance { @@ -458,10 +463,10 @@ private: BOOL mCapabilitiesReceived; BOOL mReleaseNotesRequested; BOOL mDead; //if true, this region is in the process of deleting. - + typedef std::map<U32, std::vector<U32> > orphan_list_t; orphan_list_t mOrphanMap; - + class CacheMissItem { public: @@ -469,7 +474,7 @@ private: U32 mID; //local object id LLViewerRegion::eCacheMissType mType; //cache miss type - + typedef std::list<CacheMissItem> cache_miss_list_t; }; CacheMissItem::cache_miss_list_t mCacheMissList; |