summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llvoavatar.cpp15
-rw-r--r--indra/newview/llvovolume.cpp4
2 files changed, 9 insertions, 10 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 96a1beffbc..8888879b8a 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -118,6 +118,9 @@ extern U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG;
const F32 MAX_HOVER_Z = 2.0;
const F32 MIN_HOVER_Z = -2.0;
+const F32 MIN_ATTACHMENT_COMPLEXITY = 0.f;
+const F32 MAX_ATTACHMENT_COMPLEXITY = 1.0e6f;
+
using namespace LLAvatarAppearanceDefines;
//-----------------------------------------------------------------------------
@@ -9056,10 +9059,10 @@ void LLVOAvatar::calculateUpdateRenderComplexity()
const LLVOVolume* volume = drawable->getVOVolume();
if (volume)
{
- U32 attachment_total_cost = 0;
- U32 attachment_volume_cost = 0;
- U32 attachment_texture_cost = 0;
- U32 attachment_children_cost = 0;
+ F32 attachment_total_cost = 0;
+ F32 attachment_volume_cost = 0;
+ F32 attachment_texture_cost = 0;
+ F32 attachment_children_cost = 0;
attachment_volume_cost += volume->getRenderCost(textures);
@@ -9083,7 +9086,6 @@ void LLVOAvatar::calculateUpdateRenderComplexity()
// add the cost of each individual texture in the linkset
attachment_texture_cost += volume_texture->second;
}
-
attachment_total_cost = attachment_volume_cost + attachment_texture_cost + attachment_children_cost;
LL_DEBUGS("ARCdetail") << "Attachment costs " << attached_object->getAttachmentItemID()
<< " total: " << attachment_total_cost
@@ -9092,7 +9094,8 @@ void LLVOAvatar::calculateUpdateRenderComplexity()
<< ", " << volume->numChildren()
<< " children: " << attachment_children_cost
<< LL_ENDL;
- cost += attachment_total_cost;
+ // Limit attachment complexity to avoid signed integer flipping of the wearer's ACI
+ cost += (U32)llclamp(attachment_total_cost, MIN_ATTACHMENT_COMPLEXITY, MAX_ATTACHMENT_COMPLEXITY);
}
}
}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 098996147f..657babd92c 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -81,8 +81,6 @@
const F32 FORCE_SIMPLE_RENDER_AREA = 512.f;
const F32 FORCE_CULL_AREA = 8.f;
-const F32 MIN_RENDER_COMPLEXITY = 0.f;
-const F32 MAX_RENDER_COMPLEXITY = 1.0e6f;
U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG = 1;
BOOL gAnimateTextures = TRUE;
@@ -3617,8 +3615,6 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
shame += media_faces * ARC_MEDIA_FACE_COST;
}
- shame = llclamp(shame, MIN_RENDER_COMPLEXITY, MAX_RENDER_COMPLEXITY);
-
if (shame > mRenderComplexity_current)
{
mRenderComplexity_current = (S32)shame;