summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.h
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-05-03 17:30:02 -0500
committerRunitaiLinden <davep@lindenlab.com>2023-05-03 17:30:02 -0500
commit1cadfd44fe5ddafaf3ba3560bd8ec8e1351b347d (patch)
tree8c75a8f75bc8ab17f34bc9c94a644976d88c06f8 /indra/newview/llvovolume.h
parente09475713b7abe6fcb916f4a770081a1696b57ab (diff)
DRTVWR-559 WIP - optimize ARC calculation et al.
Diffstat (limited to 'indra/newview/llvovolume.h')
-rw-r--r--indra/newview/llvovolume.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index 9cfd90a940..d509a7e2ab 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -34,8 +34,8 @@
#include "lllocalbitmaps.h"
#include "m3math.h" // LLMatrix3
#include "m4math.h" // LLMatrix4
-#include <map>
-#include <set>
+#include <unordered_map>
+#include <unordered_set>
class LLViewerTextureAnim;
@@ -146,7 +146,8 @@ public:
const LLMatrix4& getRelativeXform() const { return mRelativeXform; }
const LLMatrix3& getRelativeXformInvTrans() const { return mRelativeXformInvTrans; }
/*virtual*/ const LLMatrix4 getRenderMatrix() const override;
- typedef std::map<LLUUID, S32> texture_cost_t;
+ typedef std::unordered_set<const LLViewerTexture*> texture_cost_t;
+ static S32 getTextureCost(const LLViewerTexture* img);
U32 getRenderCost(texture_cost_t &textures) const;
/*virtual*/ F32 getEstTrianglesMax() const override;
/*virtual*/ F32 getEstTrianglesStreamingCost() const override;
@@ -267,6 +268,7 @@ public:
void setSpotLightParams(LLVector3 params);
BOOL getIsLight() const;
+ bool getIsLightFast() const;
// Get the light color in sRGB color space NOT scaled by intensity.
@@ -315,7 +317,15 @@ public:
virtual BOOL isRiggedMesh() const override;
virtual BOOL hasLightTexture() const override;
-
+ // fast variants above that use state that is filled in later
+ // not reliable early in the life of an object, but should be used after
+ // object is loaded
+ bool isFlexibleFast() const;
+ bool isSculptedFast() const;
+ bool isMeshFast() const;
+ bool isRiggedMeshFast() const;
+ bool isAnimatedObjectFast() const;
+
BOOL isVolumeGlobal() const;
BOOL canBeFlexible() const;
BOOL setIsFlexible(BOOL is_flexible);
@@ -461,6 +471,13 @@ private:
S32 mIndexInTex[LLRender::NUM_VOLUME_TEXTURE_CHANNELS];
S32 mMDCImplCount;
+ // cached value of getIsLight to avoid redundant map lookups
+ // accessed by getIsLightFast
+ mutable bool mIsLight = false;
+
+ // cached value of getIsAnimatedObject to avoid redundant map lookups
+ // accessed by getIsAnimatedObjectFast
+ mutable bool mIsAnimatedObject = false;
bool mResetDebugText;
LLPointer<LLRiggedVolume> mRiggedVolume;
@@ -475,7 +492,6 @@ public:
static LLPointer<LLObjectMediaDataClient> sObjectMediaClient;
static LLPointer<LLObjectMediaNavigateClient> sObjectMediaNavigateClient;
-
protected:
static S32 sNumLODChanges;