summaryrefslogtreecommitdiff
path: root/indra/newview/llmeshrepository.h
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-11-11 20:53:50 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-01-28 20:46:52 +0200
commit8f274bfdf9683895a2245b531dc45f4d047d69d6 (patch)
tree9dbd82c92d523e432888ff011fcd623150b433f9 /indra/newview/llmeshrepository.h
parent5029f0322f264e17f7509952f7bf9812db17a9ec (diff)
#1186 Make lod and skin request share priorities
skins are needed to decloud avatars as much as lods
Diffstat (limited to 'indra/newview/llmeshrepository.h')
-rw-r--r--indra/newview/llmeshrepository.h90
1 files changed, 75 insertions, 15 deletions
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index b5c2424578..c5b2a910ce 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -63,6 +63,16 @@ typedef enum e_mesh_processing_result_enum
MESH_UNKNOWN
} EMeshProcessingResult;
+typedef enum e_mesh_request_type_enum
+{
+ MESH_REQUEST_HEADER,
+ MESH_REQUEST_LOD,
+ MESH_REQUEST_SKIN,
+ MESH_REQUEST_DECOMPOSITION,
+ MESH_REQUEST_PHYSICS,
+ MESH_REQUEST_UKNOWN
+} EMeshRequestType;
+
class LLMeshUploadData
{
public:
@@ -183,7 +193,8 @@ public:
class RequestStats
{
public:
- RequestStats() : mRetries(0) {};
+
+ RequestStats() :mRetries(0) {};
void updateTime();
bool canRetry() const;
@@ -195,6 +206,67 @@ private:
LLFrameTimer mTimer;
};
+
+class PendingRequestBase
+{
+public:
+ struct CompareScoreGreater
+ {
+ bool operator()(const PendingRequestBase& lhs, const PendingRequestBase& rhs)
+ {
+ return lhs.mScore > rhs.mScore; // greatest = first
+ }
+ };
+
+ PendingRequestBase() : mScore(0.f) {};
+ virtual ~PendingRequestBase() {}
+
+ bool operator<(const PendingRequestBase& rhs) const
+ {
+ return mId < rhs.mId;
+ }
+
+ void setScore(F32 score) { mScore = score; }
+ F32 getScore() const { return mScore; }
+ LLUUID getId() const { return mId; }
+ virtual EMeshRequestType getRequestType() const { return MESH_REQUEST_UKNOWN; }
+
+protected:
+ F32 mScore;
+ LLUUID mId;
+};
+
+class PendingRequestLOD : public PendingRequestBase
+{
+public:
+ LLVolumeParams mMeshParams;
+ S32 mLOD;
+
+ PendingRequestLOD(const LLVolumeParams& mesh_params, S32 lod)
+ : PendingRequestBase(), mMeshParams(mesh_params), mLOD(lod)
+ {
+ mId = mMeshParams.getSculptID();
+ }
+
+ EMeshRequestType getRequestType() const override { return MESH_REQUEST_LOD; }
+};
+
+class PendingRequestUUID : public PendingRequestBase
+{
+public:
+
+ PendingRequestUUID(const LLUUID& id, EMeshRequestType type)
+ : PendingRequestBase(), mRequestType(type)
+ {
+ mId = id;
+ }
+
+ EMeshRequestType getRequestType() const override { return mRequestType; }
+
+private:
+ EMeshRequestType mRequestType;
+};
+
class LLMeshHeader
{
public:
@@ -292,22 +364,13 @@ public:
public:
LLVolumeParams mMeshParams;
S32 mLOD;
- F32 mScore;
LODRequest(const LLVolumeParams& mesh_params, S32 lod)
- : RequestStats(), mMeshParams(mesh_params), mLOD(lod), mScore(0.f)
+ : RequestStats(), mMeshParams(mesh_params), mLOD(lod)
{
}
};
- struct CompareScoreGreater
- {
- bool operator()(const LODRequest& lhs, const LODRequest& rhs)
- {
- return lhs.mScore > rhs.mScore; // greatest = first
- }
- };
-
class UUIDBasedRequest : public RequestStats
{
public:
@@ -695,15 +758,12 @@ public:
LLMutex* mMeshMutex;
- std::vector<LLMeshRepoThread::LODRequest> mPendingRequests;
+ std::vector<PendingRequestBase> mPendingRequests;
//list of mesh ids awaiting skin info
typedef boost::unordered_map<LLUUID, std::vector<LLVOVolume*> > skin_load_map;
skin_load_map mLoadingSkins;
- //list of mesh ids that need to send skin info fetch requests
- std::queue<LLUUID> mPendingSkinRequests;
-
//list of mesh ids awaiting decompositions
std::unordered_set<LLUUID> mLoadingDecompositions;