summaryrefslogtreecommitdiff
path: root/indra/newview/llvocache.h
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-03-07 23:54:11 -0700
committerXiaohong Bao <bao@lindenlab.com>2013-03-07 23:54:11 -0700
commit50b32cf2bdb93fad14770aa0f6b92fb3815ebdf0 (patch)
tree773b4e3931bd593ce42992fab1f5a2cd22509d5a /indra/newview/llvocache.h
parent03b7fb589a9b5628418364c970ea402448f312be (diff)
for SH-3937: interesting: implement the new cache probe logic
Diffstat (limited to 'indra/newview/llvocache.h')
-rw-r--r--indra/newview/llvocache.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h
index 7c1706e650..a64944f562 100644
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -41,7 +41,7 @@ class LLCamera;
class LLVOCacheEntry : public LLViewerOctreeEntryData
{
public:
- enum
+ enum //low 16-bit state
{
INACTIVE = 0x00000000, //not visible
IN_QUEUE = 0x00000001, //in visible queue, object to be created
@@ -49,11 +49,6 @@ public:
ACTIVE = 0x00000004 //object created, and in rendering pipeline.
};
- enum
- {
- ADD_TO_CACHE_TREE = 0x00010000, //has parent
- };
-
struct CompareVOCacheEntry
{
bool operator()(const LLVOCacheEntry* const& lhs, const LLVOCacheEntry* const& rhs)
@@ -84,12 +79,10 @@ public:
LLVOCacheEntry();
void setState(U32 state);
- void clearState(U32 state) {mState &= ~state;}
- void addState(U32 state) {mState |= state;}
- bool isState(U32 state) {return (mState & 0xffff) == state;}
+ //void clearState(U32 state) {mState &= ~state;}
+ bool isState(U32 state) {return mState == state;}
bool hasState(U32 state) {return mState & state;}
- U32 getState() const {return (mState & 0xffff);}
- U32 getFullState() const {return mState;}
+ U32 getState() const {return mState;}
U32 getLocalID() const { return mLocalID; }
U32 getCRC() const { return mCRC; }
@@ -111,6 +104,9 @@ public:
void copyTo(LLVOCacheEntry* new_entry); //copy variables
/*virtual*/ void setOctreeEntry(LLViewerOctreeEntry* entry);
+ void setParentID(U32 id) {mParentID = id;}
+ U32 getParentID() const {return mParentID;}
+
void addChild(LLVOCacheEntry* entry);
LLVOCacheEntry* getChild(S32 i) {return mChildrenList[i];}
S32 getNumOfChildren() {return mChildrenList.size();}
@@ -119,6 +115,9 @@ public:
//called from processing object update message
void setBoundingInfo(const LLVector3& pos, const LLVector3& scale);
void updateBoundingInfo(LLVOCacheEntry* parent);
+
+ void setTouched(BOOL touched = TRUE) {mTouched = touched;}
+ BOOL isTouched() const {return mTouched;}
public:
typedef std::map<U32, LLPointer<LLVOCacheEntry> > vocache_entry_map_t;
@@ -127,6 +126,7 @@ public:
protected:
U32 mLocalID;
+ U32 mParentID;
U32 mCRC;
S32 mHitCount;
S32 mDupeCount;
@@ -139,6 +139,8 @@ protected:
S32 mRepeatedVisCounter; //number of repeatedly visible within a short time.
U32 mState; //high 16 bits reserved for special use.
std::vector<LLVOCacheEntry*> mChildrenList; //children entries in a linked set.
+
+ BOOL mTouched; //if set, this entry is valid, otherwise it is invalid.
};
class LLVOCachePartition : public LLViewerOctreePartition
@@ -199,7 +201,7 @@ public:
void removeCache(ELLPath location) ;
void readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) ;
- void writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache) ;
+ void writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache, BOOL full_region_cache_probe);
void removeEntry(U64 handle) ;
void setReadOnly(BOOL read_only) {mReadOnly = read_only;}