diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-02-07 23:24:33 +0200 | 
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-02-19 14:16:42 +0200 | 
| commit | 483e85cbf31e08e3692d2fb267bdaacdd0ed38a4 (patch) | |
| tree | dd4940bc371573ec7834b43e834deac626fc4dd2 /indra/newview | |
| parent | 6d0b0a77eed584c6bcf77f6cd5fdbdbf89a987d7 (diff) | |
#3488 Prioritization adjustments
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llmeshrepository.cpp | 40 | ||||
| -rw-r--r-- | indra/newview/llviewermessage.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llvoavatar.cpp | 14 | ||||
| -rw-r--r-- | indra/newview/llvoavatar.h | 1 | 
4 files changed, 38 insertions, 19 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index fdc7520d4d..0fef1e2b61 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -343,22 +343,22 @@ static LLFastTimer::DeclareTimer FTM_MESH_FETCH("Mesh Fetch");  LLMeshRepository gMeshRepo; -const U32 CACHE_PREAMBLE_VERSION = 1; -const S32 CACHE_PREAMBLE_SIZE = sizeof(U32) * 3; //version, header_size, flags -const S32 MESH_HEADER_SIZE = 4096;                      // Important:  assumption is that headers fit in this space +constexpr U32 CACHE_PREAMBLE_VERSION = 1; +constexpr S32 CACHE_PREAMBLE_SIZE = sizeof(U32) * 3; //version, header_size, flags +constexpr S32 MESH_HEADER_SIZE = 4096;                      // Important:  assumption is that headers fit in this space -const S32 REQUEST2_HIGH_WATER_MIN = 32;                 // Limits for GetMesh2 regions -const S32 REQUEST2_HIGH_WATER_MAX = 100; -const S32 REQUEST2_LOW_WATER_MIN = 16; -const S32 REQUEST2_LOW_WATER_MAX = 50; +constexpr S32 REQUEST2_HIGH_WATER_MIN = 32;                 // Limits for GetMesh2 regions +constexpr S32 REQUEST2_HIGH_WATER_MAX = 100; +constexpr S32 REQUEST2_LOW_WATER_MIN = 16; +constexpr S32 REQUEST2_LOW_WATER_MAX = 50; -const U32 LARGE_MESH_FETCH_THRESHOLD = 1U << 21;        // Size at which requests goes to narrow/slow queue -const long SMALL_MESH_XFER_TIMEOUT = 120L;              // Seconds to complete xfer, small mesh downloads -const long LARGE_MESH_XFER_TIMEOUT = 600L;              // Seconds to complete xfer, large downloads +constexpr U32 LARGE_MESH_FETCH_THRESHOLD = 1U << 21;        // Size at which requests goes to narrow/slow queue +constexpr long SMALL_MESH_XFER_TIMEOUT = 120L;              // Seconds to complete xfer, small mesh downloads +constexpr long LARGE_MESH_XFER_TIMEOUT = 600L;              // Seconds to complete xfer, large downloads -const U32 DOWNLOAD_RETRY_LIMIT = 8; -const F32 DOWNLOAD_RETRY_DELAY = 0.5f; // seconds +constexpr U32 DOWNLOAD_RETRY_LIMIT = 8; +constexpr F32 DOWNLOAD_RETRY_DELAY = 0.5f; // seconds  // Would normally like to retry on uploads as some  // retryable failures would be recoverable.  Unfortunately, @@ -368,7 +368,7 @@ const F32 DOWNLOAD_RETRY_DELAY = 0.5f; // seconds  // cap which then produces a 404 on retry destroying some  // (occasionally) useful error information.  We'll leave  // upload retries to the user as in the past.  SH-4667. -const long UPLOAD_RETRY_LIMIT = 0L; +constexpr long UPLOAD_RETRY_LIMIT = 0L;  // Maximum mesh version to support.  Three least significant digits are reserved for the minor version,  // with major version changes indicating a format change that is not backwards compatible and should not @@ -376,7 +376,7 @@ const long UPLOAD_RETRY_LIMIT = 0L;  // present, the version is 0.001. A viewer that can parse version 0.001 can also parse versions up to 0.999,  // but not 1.0 (integer 1000).  // See wiki at https://wiki.secondlife.com/wiki/Mesh/Mesh_Asset_Format -const S32 MAX_MESH_VERSION = 999; +constexpr S32 MAX_MESH_VERSION = 999;  U32 LLMeshRepository::sBytesReceived = 0;  U32 LLMeshRepository::sMeshRequestCount = 0; @@ -1869,8 +1869,8 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params)          if (size > 0)          {              // *NOTE:  if the header size is ever more than 4KB, this will break -            const S32 DISK_MINIMAL_READ = 4096; -            static thread_local U8 buffer[DISK_MINIMAL_READ * 2]; +            constexpr S32 DISK_MINIMAL_READ = 4096; +            U8 buffer[DISK_MINIMAL_READ * 2];              S32 bytes = llmin(size, DISK_MINIMAL_READ);              LLMeshRepository::sCacheBytesRead += bytes;              ++LLMeshRepository::sCacheReads; @@ -4337,6 +4337,12 @@ F32 calculate_score(LLVOVolume* object)                  const LLVector3* box = avatar->getLastAnimExtents();                  LLVector3 diag = box[1] - box[0];                  radius = diag.magVec(); + +                if (!avatar->isSelf() && !avatar->hasFirstFullAttachmentData()) +                { +                    // slightly deprioritize avatars that are still receiving data +                    radius *= 0.9f; +                }              }              return radius / llmax(av_drawable->mDistanceWRTCamera, 1.f);          } @@ -5385,7 +5391,7 @@ F32 LLMeshCostData::getEstTrisForStreamingCost()      F32 charged_tris = mEstTrisByLOD[3];      F32 allowed_tris = mEstTrisByLOD[3]; -    const F32 ENFORCE_FLOOR = 64.0f; +    constexpr F32 ENFORCE_FLOOR = 64.0f;      for (S32 i=2; i>=0; i--)      {          // How many tris can we have in this LOD without affecting land impact? diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index db91678254..5fd820f91d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3333,7 +3333,7 @@ void send_agent_update(bool force_send, bool send_reliable)          // we reduce the number of attachments sent to the viewer, thus prioritizing          // closer ones.          // Todo: revise and remove once server gets distance sorting. -        last_draw_disatance_step = llmax((F32)(gAgentCamera.mDrawDistance / 2.f), 64.f); +        last_draw_disatance_step = llmax((F32)(gAgentCamera.mDrawDistance / 2.f), 50.f);          msg->addF32Fast(_PREHASH_Far, last_draw_disatance_step);      }      else if (last_draw_disatance_step < gAgentCamera.mDrawDistance) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1ab27d752d..54bbc4c88a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3226,6 +3226,7 @@ void LLVOAvatar::idleUpdateLoadingEffect()              if (mFirstFullyVisible)              {                  mFirstFullyVisible = false; +                mLastCloudAttachmentCount = (S32)mSimAttachments.size();                  mFirstDecloudTime = mFirstAppearanceMessageTimer.getElapsedTimeF32();                  if (isSelf())                  { @@ -8398,7 +8399,7 @@ bool LLVOAvatar::updateIsFullyLoaded()                    );          // compare amount of attachments to one reported by simulator -        if (!loading && !isSelf() && rez_status < 4 && mLastCloudAttachmentCount < mSimAttachments.size()) +        if (!isSelf() && mLastCloudAttachmentCount < mSimAttachments.size() && mSimAttachments.size() > 0)          {              S32 attachment_count = getAttachmentCount();              if (mLastCloudAttachmentCount != attachment_count) @@ -8416,6 +8417,11 @@ bool LLVOAvatar::updateIsFullyLoaded()                  // waiting                  loading = true;              } +            else if (!loading) +            { +                // for hasFirstFullAttachmentData +                mLastCloudAttachmentCount = (S32)mSimAttachments.size(); +            }          }      }      updateRezzedStatusTimers(rez_status); @@ -8529,6 +8535,12 @@ bool LLVOAvatar::isFullyLoaded() const      return (mRenderUnloadedAvatar || mFullyLoaded);  } +bool LLVOAvatar::hasFirstFullAttachmentData() const +{ +    return !mFirstFullyVisible // Avatar is fully visible, have all data +        || mLastCloudAttachmentCount >= (S32)mSimAttachments.size(); +} +  bool LLVOAvatar::isTooComplex() const  {      bool too_complex; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index dd1725c322..263c3dadf6 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -385,6 +385,7 @@ public:      //--------------------------------------------------------------------  public:      bool            isFullyLoaded() const; +    bool            hasFirstFullAttachmentData() const;      F32             getFirstDecloudTime() const {return mFirstDecloudTime;}      // check and return current state relative to limits  | 
