From 8f274bfdf9683895a2245b531dc45f4d047d69d6 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 11 Nov 2024 20:53:50 +0200 Subject: #1186 Make lod and skin request share priorities skins are needed to decloud avatars as much as lods --- indra/newview/llmeshrepository.h | 90 +++++++++++++++++++++++++++++++++------- 1 file changed, 75 insertions(+), 15 deletions(-) (limited to 'indra/newview/llmeshrepository.h') 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 mPendingRequests; + std::vector mPendingRequests; //list of mesh ids awaiting skin info typedef boost::unordered_map > skin_load_map; skin_load_map mLoadingSkins; - //list of mesh ids that need to send skin info fetch requests - std::queue mPendingSkinRequests; - //list of mesh ids awaiting decompositions std::unordered_set mLoadingDecompositions; -- cgit v1.2.3