From 45a7fe901aa4cd7af14fa1cb894da46a988e3aa2 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 15 Jan 2013 23:01:40 -0700 Subject: for SH-3653: Can we repurpose ObjectUpdateCached:ObjectData:UpdateFlags field to carry spatial+size data? --- indra/newview/llviewerregion.h | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewerregion.h') diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 9252923aa3..4f0087ba7c 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -169,6 +169,9 @@ public: const LLVector3d &getOriginGlobal() const; LLVector3 getOriginAgent() const; + //estimate weight of cache missed object + F32 calcObjectWeight(U32 flags); + // Center is at the height of the water table. const LLVector3d &getCenterGlobal() const; LLVector3 getCenterAgent() const; @@ -316,7 +319,7 @@ public: // handle a full update message eCacheUpdateResult cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp); LLVOCacheEntry* getCacheEntryForOctree(U32 local_id); - bool probeCache(U32 local_id, U32 crc, U8 &cache_miss_type); + bool probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss_type); void requestCacheMisses(); void addCacheMissFull(const U32 local_id); @@ -356,6 +359,7 @@ private: F32 createVisibleObjects(F32 max_time); F32 updateVisibleEntries(F32 max_time); //update visible entries + void addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type, F32 weight); public: struct CompareDistance { @@ -441,8 +445,33 @@ private: BOOL mReleaseNotesRequested; BOOL mDead; //if true, this region is in the process of deleting. - LLDynamicArray mCacheMissFull; - LLDynamicArray mCacheMissCRC; + class CacheMissItem + { + public: + CacheMissItem(U32 id, LLViewerRegion::eCacheMissType miss_type, F32 weight) : mID(id), mType(miss_type), mWeight(weight){} + + U32 mID; //local object id + LLViewerRegion::eCacheMissType mType; //cache miss type + F32 mWeight; //importance of this object to the current camera. + + struct Compare + { + bool operator()(const CacheMissItem& lhs, const CacheMissItem& rhs) + { + if(lhs.mWeight == rhs.mWeight) //larger weight first + { + return &lhs < &rhs; + } + else + { + return lhs.mWeight > rhs.mWeight; //larger weight first + } + } + }; + + typedef std::set cache_miss_list_t; + }; + CacheMissItem::cache_miss_list_t mCacheMissList; caps_received_signal_t mCapabilitiesReceivedSignal; LLSD mSimulatorFeatures; -- cgit v1.2.3 From 3ed1bee350ed93f81a484a7c073c12708e73e946 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 16 Jan 2013 22:03:48 -0700 Subject: trivial: convert to unix line endings. --- indra/newview/llviewerregion.h | 52 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'indra/newview/llviewerregion.h') diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 4f0087ba7c..de14c0fe27 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -445,32 +445,32 @@ private: BOOL mReleaseNotesRequested; BOOL mDead; //if true, this region is in the process of deleting. - class CacheMissItem - { - public: - CacheMissItem(U32 id, LLViewerRegion::eCacheMissType miss_type, F32 weight) : mID(id), mType(miss_type), mWeight(weight){} - - U32 mID; //local object id - LLViewerRegion::eCacheMissType mType; //cache miss type - F32 mWeight; //importance of this object to the current camera. - - struct Compare - { - bool operator()(const CacheMissItem& lhs, const CacheMissItem& rhs) - { - if(lhs.mWeight == rhs.mWeight) //larger weight first - { - return &lhs < &rhs; - } - else - { - return lhs.mWeight > rhs.mWeight; //larger weight first - } - } - }; - - typedef std::set cache_miss_list_t; - }; + class CacheMissItem + { + public: + CacheMissItem(U32 id, LLViewerRegion::eCacheMissType miss_type, F32 weight) : mID(id), mType(miss_type), mWeight(weight){} + + U32 mID; //local object id + LLViewerRegion::eCacheMissType mType; //cache miss type + F32 mWeight; //importance of this object to the current camera. + + struct Compare + { + bool operator()(const CacheMissItem& lhs, const CacheMissItem& rhs) + { + if(lhs.mWeight == rhs.mWeight) //larger weight first + { + return &lhs < &rhs; + } + else + { + return lhs.mWeight > rhs.mWeight; //larger weight first + } + } + }; + + typedef std::set cache_miss_list_t; + }; CacheMissItem::cache_miss_list_t mCacheMissList; caps_received_signal_t mCapabilitiesReceivedSignal; -- cgit v1.2.3 From bd60fdbe44d9f996686d31cf48a3f2ca664dd301 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 28 Feb 2013 22:49:05 -0700 Subject: for SH-3824: interesting: Ensure viewer can handle object updates from entire region gracefully --- indra/newview/llviewerregion.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerregion.h') diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index de14c0fe27..6da8c191a4 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -317,6 +317,7 @@ public: } eCacheUpdateResult; // handle a full update message + eCacheUpdateResult cacheFullUpdate(LLDataPackerBinaryBuffer &dp); eCacheUpdateResult cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp); LLVOCacheEntry* getCacheEntryForOctree(U32 local_id); bool probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss_type); @@ -347,7 +348,7 @@ public: void getNeighboringRegionsStatus( std::vector& regions ); private: - void addToVOCacheTree(LLVOCacheEntry* entry); + void addToVOCacheTree(LLVOCacheEntry* entry, bool forced = false); LLViewerObject* addNewObject(LLVOCacheEntry* entry); void killObject(LLVOCacheEntry* entry, std::vector& delete_list); LLVOCacheEntry* getCacheEntry(U32 local_id); @@ -360,6 +361,7 @@ private: F32 updateVisibleEntries(F32 max_time); //update visible entries void addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type, F32 weight); + void postProcesNewEntry(LLVOCacheEntry* entry); public: struct CompareDistance { @@ -445,6 +447,21 @@ private: BOOL mReleaseNotesRequested; BOOL mDead; //if true, this region is in the process of deleting. + class OrphanList + { + public: + OrphanList(){} + OrphanList(U32 child_id){addChild(child_id);} + + void addChild(U32 child_id) {mChildList.insert(child_id);} + std::set* getChildList() {return &mChildList;} + + private: + std::set mChildList; + }; + + std::map mOrphanMap; + class CacheMissItem { public: -- cgit v1.2.3 From 50b32cf2bdb93fad14770aa0f6b92fb3815ebdf0 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 7 Mar 2013 23:54:11 -0700 Subject: for SH-3937: interesting: implement the new cache probe logic --- indra/newview/llviewerregion.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewerregion.h') diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 6da8c191a4..4fc74ee7c3 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -320,9 +320,13 @@ public: eCacheUpdateResult cacheFullUpdate(LLDataPackerBinaryBuffer &dp); eCacheUpdateResult cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp); LLVOCacheEntry* getCacheEntryForOctree(U32 local_id); + LLVOCacheEntry* getCacheEntry(U32 local_id); bool probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss_type); void requestCacheMisses(); void addCacheMissFull(const U32 local_id); + //remove from object cache if the object receives a full-update or terse update + LLViewerObject* forceToRemoveFromCache(U32 local_id, LLViewerObject* objectp); + void findOrphans(U32 parent_id); void dumpCache(); @@ -348,10 +352,9 @@ public: void getNeighboringRegionsStatus( std::vector& regions ); private: - void addToVOCacheTree(LLVOCacheEntry* entry, bool forced = false); + void addToVOCacheTree(LLVOCacheEntry* entry); LLViewerObject* addNewObject(LLVOCacheEntry* entry); - void killObject(LLVOCacheEntry* entry, std::vector& delete_list); - LLVOCacheEntry* getCacheEntry(U32 local_id); + void killObject(LLVOCacheEntry* entry, std::vector& delete_list); void removeFromVOCacheTree(LLVOCacheEntry* entry); void replaceCacheEntry(LLVOCacheEntry* old_entry, LLVOCacheEntry* new_entry); void killCacheEntry(LLVOCacheEntry* entry); //physically delete the cache entry @@ -361,7 +364,7 @@ private: F32 updateVisibleEntries(F32 max_time); //update visible entries void addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type, F32 weight); - void postProcesNewEntry(LLVOCacheEntry* entry); + void decodeBoundingInfo(LLVOCacheEntry* entry); public: struct CompareDistance { -- cgit v1.2.3 From 27bb36b1e796add58f319555bf761e417f7957ef Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 11 Mar 2013 21:23:15 -0600 Subject: for SH-3979: interesting: can not edit objects with new object cache code --- indra/newview/llviewerregion.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerregion.h') diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 4fc74ee7c3..a903f61cbc 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -317,8 +317,8 @@ public: } eCacheUpdateResult; // handle a full update message - eCacheUpdateResult cacheFullUpdate(LLDataPackerBinaryBuffer &dp); - eCacheUpdateResult cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp); + eCacheUpdateResult cacheFullUpdate(LLDataPackerBinaryBuffer &dp, U32 flags); + eCacheUpdateResult cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp, U32 flags); LLVOCacheEntry* getCacheEntryForOctree(U32 local_id); LLVOCacheEntry* getCacheEntry(U32 local_id); bool probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss_type); -- cgit v1.2.3 From 4624848a6894be669cdb19a82101ea168c407ecd Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 13 Mar 2013 22:31:19 -0600 Subject: revert changes for SH-3653: Can we repurpose ObjectUpdateCached:ObjectData:UpdateFlags field to carry spatial+size data? --- indra/newview/llviewerregion.h | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'indra/newview/llviewerregion.h') diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index a903f61cbc..15c2b36e38 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -169,9 +169,6 @@ public: const LLVector3d &getOriginGlobal() const; LLVector3 getOriginAgent() const; - //estimate weight of cache missed object - F32 calcObjectWeight(U32 flags); - // Center is at the height of the water table. const LLVector3d &getCenterGlobal() const; LLVector3 getCenterAgent() const; @@ -363,7 +360,7 @@ private: F32 createVisibleObjects(F32 max_time); F32 updateVisibleEntries(F32 max_time); //update visible entries - void addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type, F32 weight); + void addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type); void decodeBoundingInfo(LLVOCacheEntry* entry); public: struct CompareDistance @@ -468,24 +465,16 @@ private: class CacheMissItem { public: - CacheMissItem(U32 id, LLViewerRegion::eCacheMissType miss_type, F32 weight) : mID(id), mType(miss_type), mWeight(weight){} + CacheMissItem(U32 id, LLViewerRegion::eCacheMissType miss_type) : mID(id), mType(miss_type){} U32 mID; //local object id LLViewerRegion::eCacheMissType mType; //cache miss type - F32 mWeight; //importance of this object to the current camera. struct Compare { bool operator()(const CacheMissItem& lhs, const CacheMissItem& rhs) { - if(lhs.mWeight == rhs.mWeight) //larger weight first - { - return &lhs < &rhs; - } - else - { - return lhs.mWeight > rhs.mWeight; //larger weight first - } + return lhs.mID < rhs.mID; //smaller ID first. } }; -- cgit v1.2.3