diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llscenemonitor.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvieweroctree.cpp | 86 | ||||
-rw-r--r-- | indra/newview/llvieweroctree.h | 18 | ||||
-rw-r--r-- | indra/newview/llviewerregion.cpp | 36 | ||||
-rw-r--r-- | indra/newview/llviewertexturelist.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llvocache.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvocache.h | 4 |
7 files changed, 101 insertions, 71 deletions
diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index c06d9d2689..15fe77f028 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -523,7 +523,7 @@ void LLSceneMonitor::addMonitorResult() //dump results to a file _scene_monitor_results.csv void LLSceneMonitor::dumpToFile(std::string file_name) { - if(mMonitorResults.empty()) + if(mMonitorResults.empty() || !getRecording()) { return; //nothing to dump } diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 158fc4b0a9..926d791d1f 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -799,46 +799,46 @@ void LLViewerOctreeCull::visit(const OctreeNode* branch) } } -//--------------------------------------------------------------
-//class LLViewerOctreeDebug
-//virtual
-void LLViewerOctreeDebug::visit(const OctreeNode* branch)
-{
-#if 0
- llinfos << "Node: " << (U32)branch << " # Elements: " << branch->getElementCount() << " # Children: " << branch->getChildCount() << llendl;
- for (U32 i = 0; i < branch->getChildCount(); i++)
- {
- llinfos << "Child " << i << " : " << (U32)branch->getChild(i) << llendl;
- }
-#endif
- LLviewerOctreeGroup* group = (LLviewerOctreeGroup*) branch->getListener(0);
- processGroup(group);
-}
-
-//virtual
-void LLViewerOctreeDebug::processGroup(LLviewerOctreeGroup* group)
-{
-#if 0
- const LLVector4a* vec4 = group->getBounds();
- LLVector3 vec[2];
- vec[0].set(vec4[0].getF32ptr());
- vec[1].set(vec4[1].getF32ptr());
- llinfos << "Bounds: " << vec[0] << " : " << vec[1] << llendl;
-
- vec4 = group->getExtents();
- vec[0].set(vec4[0].getF32ptr());
- vec[1].set(vec4[1].getF32ptr());
- llinfos << "Extents: " << vec[0] << " : " << vec[1] << llendl;
-
- vec4 = group->getObjectBounds();
- vec[0].set(vec4[0].getF32ptr());
- vec[1].set(vec4[1].getF32ptr());
- llinfos << "ObjectBounds: " << vec[0] << " : " << vec[1] << llendl;
-
- vec4 = group->getObjectExtents();
- vec[0].set(vec4[0].getF32ptr());
- vec[1].set(vec4[1].getF32ptr());
- llinfos << "ObjectExtents: " << vec[0] << " : " << vec[1] << llendl;
-#endif
-}
-//--------------------------------------------------------------
+//-------------------------------------------------------------- +//class LLViewerOctreeDebug +//virtual +void LLViewerOctreeDebug::visit(const OctreeNode* branch) +{ +#if 0 + llinfos << "Node: " << (U32)branch << " # Elements: " << branch->getElementCount() << " # Children: " << branch->getChildCount() << llendl; + for (U32 i = 0; i < branch->getChildCount(); i++) + { + llinfos << "Child " << i << " : " << (U32)branch->getChild(i) << llendl; + } +#endif + LLviewerOctreeGroup* group = (LLviewerOctreeGroup*) branch->getListener(0); + processGroup(group); +} + +//virtual +void LLViewerOctreeDebug::processGroup(LLviewerOctreeGroup* group) +{ +#if 0 + const LLVector4a* vec4 = group->getBounds(); + LLVector3 vec[2]; + vec[0].set(vec4[0].getF32ptr()); + vec[1].set(vec4[1].getF32ptr()); + llinfos << "Bounds: " << vec[0] << " : " << vec[1] << llendl; + + vec4 = group->getExtents(); + vec[0].set(vec4[0].getF32ptr()); + vec[1].set(vec4[1].getF32ptr()); + llinfos << "Extents: " << vec[0] << " : " << vec[1] << llendl; + + vec4 = group->getObjectBounds(); + vec[0].set(vec4[0].getF32ptr()); + vec[1].set(vec4[1].getF32ptr()); + llinfos << "ObjectBounds: " << vec[0] << " : " << vec[1] << llendl; + + vec4 = group->getObjectExtents(); + vec[0].set(vec4[0].getF32ptr()); + vec[1].set(vec4[1].getF32ptr()); + llinfos << "ObjectExtents: " << vec[0] << " : " << vec[1] << llendl; +#endif +} +//-------------------------------------------------------------- diff --git a/indra/newview/llvieweroctree.h b/indra/newview/llvieweroctree.h index 21cc934d77..b6faf4c7ba 100644 --- a/indra/newview/llvieweroctree.h +++ b/indra/newview/llvieweroctree.h @@ -324,15 +324,15 @@ protected: S32 mRes; }; -//scan the octree, output the info of each node for debug use.
-class LLViewerOctreeDebug : public OctreeTraveler
-{
-public:
- virtual void processGroup(LLviewerOctreeGroup* group);
- virtual void visit(const OctreeNode* branch);
-
-public:
- static BOOL sInDebug;
+//scan the octree, output the info of each node for debug use. +class LLViewerOctreeDebug : public OctreeTraveler +{ +public: + virtual void processGroup(LLviewerOctreeGroup* group); + virtual void visit(const OctreeNode* branch); + +public: + static BOOL sInDebug; }; #endif diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index bed047ff0b..84e9c8ea9a 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -465,8 +465,8 @@ void LLViewerRegion::saveObjectCache() if(LLVOCache::hasInstance()) { const F32 start_time_threshold = 600.0f; //seconds - bool removal_enabled = mRegionTimer.getElapsedTimeF32() > start_time_threshold; //allow to remove invalid objects from object cache file. - + bool removal_enabled = sVOCacheCullingEnabled && (mRegionTimer.getElapsedTimeF32() > start_time_threshold); //allow to remove invalid objects from object cache file. + LLVOCache::getInstance()->writeToCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap, mCacheDirty, removal_enabled) ; mCacheDirty = FALSE; } @@ -1120,8 +1120,13 @@ BOOL LLViewerRegion::idleUpdate(F32 max_update_time) max_update_time -= update_timer.getElapsedTimeF32(); if(max_update_time < 0.f || mImpl->mCacheMap.empty()) { - return did_update; -} + return did_update; + } + + if(!sVOCacheCullingEnabled) + { + return did_update; + } sCurRegionp = this; @@ -1704,6 +1709,12 @@ void LLViewerRegion::findOrphans(U32 parent_id) void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry) { + if(!sVOCacheCullingEnabled) + { + gObjectList.processObjectUpdateFromCache(entry, this); + return; + } + if(entry != NULL && !entry->getEntry()) { entry->setOctreeEntry(NULL); @@ -1882,12 +1893,17 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObjec } LLVOCacheEntry* LLViewerRegion::getCacheEntryForOctree(U32 local_id) +{ + if(!sVOCacheCullingEnabled) { + return NULL; + } + LLVOCacheEntry* entry = getCacheEntry(local_id); removeFromVOCacheTree(entry); return entry; - } +} LLVOCacheEntry* LLViewerRegion::getCacheEntry(U32 local_id) { @@ -2172,10 +2188,14 @@ void LLViewerRegion::unpackRegionHandshake() msg->addUUID("SessionID", gAgent.getSessionID()); msg->nextBlock("RegionInfo"); - U32 flags = 0x00000001; //set the bit 0 to be 1 to ask sim to send all cacheable objects. - if(mImpl->mCacheMap.empty()) + U32 flags = 0; + if(sVOCacheCullingEnabled) { - flags |= 0x00000002; //set the bit 1 to be 1 to tell sim the cache file is empty, no need to send cache probes. + flags = 0x00000001; //set the bit 0 to be 1 to ask sim to send all cacheable objects. + if(mImpl->mCacheMap.empty()) + { + flags |= 0x00000002; //set the bit 1 to be 1 to tell sim the cache file is empty, no need to send cache probes. + } } msg->addU32("Flags", flags ); msg->sendReliable(host); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index ae677f541b..759b0c580f 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -60,7 +60,7 @@ #include "llxuiparser.h" #include "lltracerecording.h" #include "llviewerdisplay.h" - +#include "llstartup.h" //////////////////////////////////////////////////////////////////////////// void (*LLViewerTextureList::sUUIDCallback)(void **, const LLUUID&) = NULL; @@ -708,7 +708,17 @@ void LLViewerTextureList::updateImagesDecodePriorities() { // Update the decode priority for N images each frame { - static const S32 MAX_PRIO_UPDATES = gSavedSettings.getS32("TextureFetchUpdatePriorities"); // default: 32 + F32 lazy_flush_timeout = 30.f; // stop decoding + F32 max_inactive_time = 20.f; // actually delete + S32 min_refs = 3; // 1 for mImageList, 1 for mUUIDMap, 1 for local reference + if(LLStartUp::getStartupState() < STATE_STARTED) + { + //do not remove pre-fetched images if viewer does not finish logging in. + lazy_flush_timeout = 30000.f; + max_inactive_time = 20000.f; + } + + static const S32 MAX_PRIO_UPDATES = gSavedSettings.getS32("TextureFetchUpdatePriorities"); // default: 32 const size_t max_update_count = llmin((S32) (MAX_PRIO_UPDATES*MAX_PRIO_UPDATES*gFrameIntervalSeconds.value()) + 1, MAX_PRIO_UPDATES); S32 update_counter = llmin(max_update_count, mUUIDMap.size()); uuid_map_t::iterator iter = mUUIDMap.upper_bound(mLastUpdateUUID); @@ -731,14 +741,10 @@ void LLViewerTextureList::updateImagesDecodePriorities() // // Flush formatted images using a lazy flush // - const F32 LAZY_FLUSH_TIMEOUT = 30.f; // stop decoding - const F32 MAX_INACTIVE_TIME = 20.f; // actually delete - S32 min_refs = 3; // 1 for mImageList, 1 for mUUIDMap, 1 for local reference - S32 num_refs = imagep->getNumRefs(); if (num_refs == min_refs) { - if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > LAZY_FLUSH_TIMEOUT) + if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > lazy_flush_timeout) { // Remove the unused image from the image list deleteImage(imagep); @@ -750,7 +756,7 @@ void LLViewerTextureList::updateImagesDecodePriorities() { if(imagep->hasSavedRawImage()) { - if(imagep->getElapsedLastReferencedSavedRawImageTime() > MAX_INACTIVE_TIME) + if(imagep->getElapsedLastReferencedSavedRawImageTime() > max_inactive_time) { imagep->destroySavedRawImage() ; } @@ -767,7 +773,7 @@ void LLViewerTextureList::updateImagesDecodePriorities() } else if(imagep->isInactive()) { - if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > MAX_INACTIVE_TIME) + if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > max_inactive_time) { imagep->setDeletionCandidate() ; } diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index caa87eb1eb..1dd149631a 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -34,6 +34,8 @@ #include "llviewerregion.h" #include "pipeline.h" +LLTrace::MemStatHandle LLVOCachePartition::sMemStat("LLVOCachePartition"); + BOOL check_read(LLAPRFile* apr_file, void* src, S32 n_bytes) { return apr_file->read(src, n_bytes) == n_bytes ; diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 5f2dd63051..4b775a4288 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -147,7 +147,7 @@ protected: BOOL mTouched; //if set, this entry is valid, otherwise it is invalid. }; -class LLVOCachePartition : public LLViewerOctreePartition +class LLVOCachePartition : public LLViewerOctreePartition, public LLTrace::MemTrackable<LLVOCachePartition> { public: LLVOCachePartition(LLViewerRegion* regionp); @@ -155,6 +155,8 @@ public: void addEntry(LLViewerOctreeEntry* entry); void removeEntry(LLViewerOctreeEntry* entry); /*virtual*/ S32 cull(LLCamera &camera); + + static LLTrace::MemStatHandle sMemStat; }; // |