summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-03-13 22:31:19 -0600
committerXiaohong Bao <bao@lindenlab.com>2013-03-13 22:31:19 -0600
commit4624848a6894be669cdb19a82101ea168c407ecd (patch)
treeb74cef281742fc9ee03fe495d20ae7e06ee2b823
parent27bb36b1e796add58f319555bf761e417f7957ef (diff)
revert changes for SH-3653: Can we repurpose ObjectUpdateCached:ObjectData:UpdateFlags field to carry spatial+size data?
-rw-r--r--indra/newview/llviewerregion.cpp22
-rw-r--r--indra/newview/llviewerregion.h17
2 files changed, 8 insertions, 31 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index c74e7158b6..bf4bff60d7 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1896,21 +1896,9 @@ LLVOCacheEntry* LLViewerRegion::getCacheEntry(U32 local_id)
return NULL;
}
-//estimate weight of cache missed object
-F32 LLViewerRegion::calcObjectWeight(U32 flags)
+void LLViewerRegion::addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type)
{
- LLVector3 pos((F32)(flags & 0xff) + 0.5f, (F32)((flags >> 8) & 0xff) + 0.5f, (F32)((flags >> 16) & 0xff) * 16.f + 8.0f);
- F32 rad = (F32)((flags >> 24) & 0xff);
-
- pos += getOriginAgent();
- pos -= LLViewerCamera::getInstance()->getOrigin();
-
- return 100.f * rad * rad / pos.lengthSquared();
-}
-
-void LLViewerRegion::addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type, F32 weight)
-{
- mCacheMissList.insert(CacheMissItem(id, miss_type, weight));
+ mCacheMissList.insert(CacheMissItem(id, miss_type));
}
// Get data packer for this object, if we have cached data
@@ -1949,13 +1937,13 @@ bool LLViewerRegion::probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss
{
// llinfos << "CRC miss for " << local_id << llendl;
- addCacheMiss(local_id, CACHE_MISS_TYPE_CRC, calcObjectWeight(flags));
+ addCacheMiss(local_id, CACHE_MISS_TYPE_CRC);
}
}
else
{
// llinfos << "Cache miss for " << local_id << llendl;
- addCacheMiss(local_id, CACHE_MISS_TYPE_FULL, calcObjectWeight(flags));
+ addCacheMiss(local_id, CACHE_MISS_TYPE_FULL);
}
return false;
@@ -1963,7 +1951,7 @@ bool LLViewerRegion::probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss
void LLViewerRegion::addCacheMissFull(const U32 local_id)
{
- addCacheMiss(local_id, CACHE_MISS_TYPE_FULL, 100.f);
+ addCacheMiss(local_id, CACHE_MISS_TYPE_FULL);
}
void LLViewerRegion::requestCacheMisses()
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.
}
};