summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2014-02-12 10:32:02 -0800
committerRichard Linden <none@none>2014-02-12 10:32:02 -0800
commit5866bb7ef09b786f8f195770a70dc4289d183ca0 (patch)
tree0be3b5e63506bf30edd3748f9e31740ae9ebbaa8 /indra/newview/llviewerregion.h
parent413be91cf5044889ade97dcbec4b17fceff122e3 (diff)
parenta8192fbf60540e42dcff5f1efb8bf8cafbfac484 (diff)
merge with release
Diffstat (limited to 'indra/newview/llviewerregion.h')
-rwxr-xr-xindra/newview/llviewerregion.h132
1 files changed, 110 insertions, 22 deletions
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 8f8bfa23c1..7f6a8186a5 100755
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -32,9 +32,7 @@
#include <string>
#include <boost/signals2.hpp>
-#include "lldarray.h"
#include "llwind.h"
-#include "llstat.h"
#include "v3dmath.h"
#include "llstring.h"
#include "llregionflags.h"
@@ -67,8 +65,11 @@ class LLDataPacker;
class LLDataPackerBinaryBuffer;
class LLHost;
class LLBBox;
-
+class LLSpatialGroup;
+class LLDrawable;
class LLViewerRegionImpl;
+class LLViewerOctreeGroup;
+class LLVOCachePartition;
class LLViewerRegion: public LLCapabilityProvider // implements this interface
{
@@ -86,6 +87,7 @@ public:
PARTITION_VOLUME,
PARTITION_BRIDGE,
PARTITION_HUD_PARTICLE,
+ PARTITION_VO_CACHE,
PARTITION_NONE,
NUM_PARTITIONS
} eObjectPartitions;
@@ -219,11 +221,21 @@ public:
// can process the message.
static void processRegionInfo(LLMessageSystem* msg, void**);
+ //check if the viewer camera is static
+ static BOOL isViewerCameraStatic();
+ static void calcNewObjectCreationThrottle();
+
void setCacheID(const LLUUID& id);
F32 getWidth() const { return mWidth; }
- BOOL idleUpdate(F32 max_update_time);
+ void idleUpdate(F32 max_update_time);
+ void lightIdleUpdate();
+ bool addVisibleGroup(LLViewerOctreeGroup* group);
+ void addVisibleChildCacheEntry(LLVOCacheEntry* parent, LLVOCacheEntry* child);
+ void addActiveCacheEntry(LLVOCacheEntry* entry);
+ void removeActiveCacheEntry(LLVOCacheEntry* entry, LLDrawable* drawablep);
+ void killCacheEntry(U32 local_id); //physically delete the cache entry
// Like idleUpdate, but forces everything to complete regardless of
// how long it takes.
@@ -316,11 +328,17 @@ public:
} eCacheUpdateResult;
// handle a full update message
- eCacheUpdateResult cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp);
- LLDataPacker *getDP(U32 local_id, U32 crc, U8 &cache_miss_type);
+ 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 valid = true);
+ bool probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss_type);
void requestCacheMisses();
void addCacheMissFull(const U32 local_id);
-
+ //update object cache if the object receives a full-update or terse update
+ LLViewerObject* updateCacheEntry(U32 local_id, LLViewerObject* objectp, U32 update_type);
+ void findOrphans(U32 parent_id);
+ void clearCachedVisibleObjects();
void dumpCache();
void unpackRegionHandshake();
@@ -333,7 +351,10 @@ public:
virtual std::string getDescription() const;
std::string getHttpUrl() const { return mHttpUrl ;}
+ U32 getNumOfVisibleGroups() const;
+ U32 getNumOfActiveCachedObjects() const;
LLSpatialPartition* getSpatialPartition(U32 type);
+ LLVOCachePartition* getVOCachePartition();
bool objectIsReturnable(const LLVector3& pos, const std::vector<LLBBox>& boxes) const;
bool childrenObjectReturnable( const std::vector<LLBBox>& boxes ) const;
@@ -343,12 +364,35 @@ public:
void getNeighboringRegionsStatus( std::vector<S32>& regions );
const LLViewerRegionImpl * getRegionImpl() const { return mImpl; }
LLViewerRegionImpl * getRegionImplNC() { return mImpl; }
-
+
// implements the materials capability throttle
bool materialsCapThrottled() const { return !mMaterialsCapThrottleTimer.hasExpired(); }
void resetMaterialsCapThrottle();
U32 getMaxMaterialsPerTransaction() const;
+
+ void removeFromCreatedList(U32 local_id);
+ void addToCreatedList(U32 local_id);
+
+ BOOL isPaused() const {return mPaused;}
+ S32 getLastUpdate() const {return mLastUpdate;}
+
+ static BOOL isNewObjectCreationThrottleDisabled() {return sNewObjectCreationThrottle < 0;}
+
+private:
+ void addToVOCacheTree(LLVOCacheEntry* entry);
+ LLViewerObject* addNewObject(LLVOCacheEntry* entry);
+ void killObject(LLVOCacheEntry* entry, std::vector<LLDrawable*>& delete_list);
+ void removeFromVOCacheTree(LLVOCacheEntry* entry);
+ void killCacheEntry(LLVOCacheEntry* entry, bool for_rendering = false); //physically delete the cache entry
+ void killInvisibleObjects(F32 max_time);
+ void createVisibleObjects(F32 max_time);
+ void updateVisibleEntries(F32 max_time); //update visible entries
+
+ void addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type);
+ void decodeBoundingInfo(LLVOCacheEntry* entry);
+ bool isNonCacheableObjectCreated(U32 local_id);
+
public:
struct CompareDistance
{
@@ -368,9 +412,8 @@ public:
LLWind mWind;
LLViewerParcelOverlay *mParcelOverlay;
- LLStat mBitStat;
- LLStat mPacketsStat;
- LLStat mPacketsLostStat;
+ F32Bits mBitsReceived;
+ F32 mPacketsReceived;
LLMatrix4 mRenderMatrix;
@@ -379,17 +422,47 @@ public:
// messaging system in which the previous message only sends and parses the
// positions stored in the first array so they're maintained separately until
// we stop supporting the old CoarseLocationUpdate message.
- LLDynamicArray<U32> mMapAvatars;
- LLDynamicArray<LLUUID> mMapAvatarIDs;
+ std::vector<U32> mMapAvatars;
+ std::vector<LLUUID> mMapAvatarIDs;
+
+ static BOOL sVOCacheCullingEnabled; //vo cache culling enabled or not.
+ static S32 sLastCameraUpdated;
LLFrameTimer & getRenderInfoRequestTimer() { return mRenderInfoRequestTimer; };
+ struct CompareRegionByLastUpdate
+ {
+ bool operator()(const LLViewerRegion* const& lhs, const LLViewerRegion* const& rhs)
+ {
+ S32 lpa = lhs->getLastUpdate();
+ S32 rpa = rhs->getLastUpdate();
+
+ //small mLastUpdate first
+ if(lpa < rpa)
+ {
+ return true;
+ }
+ else if(lpa > rpa)
+ {
+ return false;
+ }
+ else
+ {
+ return lhs < rhs;
+ }
+ }
+ };
+ typedef std::set<LLViewerRegion*, CompareRegionByLastUpdate> region_priority_list_t;
+
private:
+ static S32 sNewObjectCreationThrottle;
LLViewerRegionImpl * mImpl;
+ LLFrameTimer mRegionTimer;
F32 mWidth; // Width of region on a side (meters)
U64 mHandle;
F32 mTimeDilation; // time dilation of physics simulation on simulator
+ S32 mLastUpdate; //last time called idleUpdate()
// simulator name
std::string mName;
@@ -399,14 +472,14 @@ private:
BOOL mIsEstateManager;
U32 mPacketsIn;
- U32 mBitsIn;
- U32 mLastBitsIn;
+ U32Bits mBitsIn,
+ mLastBitsIn;
U32 mLastPacketsIn;
U32 mPacketsOut;
U32 mLastPacketsOut;
S32 mPacketsLost;
S32 mLastPacketsLost;
- U32 mPingDelay;
+ U32Milliseconds mPingDelay;
F32 mDeltaTime; // Time since last measurement of lastPackets, Bits, etc
U64 mRegionFlags; // includes damage flags
@@ -417,6 +490,9 @@ private:
F32 mCameraDistanceSquared; // updated once per frame
U8 mCentralBakeVersion;
+ LLVOCacheEntry* mLastVisitedEntry;
+ U32 mInvisibilityCheckHistory;
+
// Information for Homestead / CR-53
S32 mClassID;
S32 mCPURatio;
@@ -431,16 +507,28 @@ private:
// a structure of size 2^14 = 16,000
BOOL mCacheLoaded;
BOOL mCacheDirty;
+ BOOL mAlive; // can become false if circuit disconnects
+ BOOL mCapabilitiesReceived;
+ BOOL mReleaseNotesRequested;
+ BOOL mDead; //if true, this region is in the process of deleting.
+ BOOL mPaused; //pause processing the objects in the region
- LLDynamicArray<U32> mCacheMissFull;
- LLDynamicArray<U32> mCacheMissCRC;
+ typedef std::map<U32, std::vector<U32> > orphan_list_t;
+ orphan_list_t mOrphanMap;
- bool mAlive; // can become false if circuit disconnects
- bool mCapabilitiesReceived;
- caps_received_signal_t mCapabilitiesReceivedSignal;
+ class CacheMissItem
+ {
+ public:
+ CacheMissItem(U32 id, LLViewerRegion::eCacheMissType miss_type) : mID(id), mType(miss_type){}
- BOOL mReleaseNotesRequested;
+ 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;
+ caps_received_signal_t mCapabilitiesReceivedSignal;
LLSD mSimulatorFeatures;
// the materials capability throttle