summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2017-11-17 14:26:34 +0000
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2017-11-17 14:26:34 +0000
commit84b6bce4ee9299454aca75d8f876b6582b756ff6 (patch)
treec0ac13e49f86d9e3ea9f12e9bbb5acbf139bc82d /indra
parent1fd5d03847437e96fa6b5a08e08e36cb218f990f (diff)
SL-704 - attachment surface area now computed in bulk rather than updated incrementally. Same dubious formula.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llspatialpartition.cpp10
-rw-r--r--indra/newview/llvoavatar.cpp29
-rw-r--r--indra/newview/llvoavatar.h3
-rw-r--r--indra/newview/llvovolume.cpp23
4 files changed, 8 insertions, 57 deletions
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 0fd36766b3..0db1806fd8 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -856,16 +856,6 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node)
}
}
- //clean up avatar attachment stats
- LLSpatialBridge* bridge = getSpatialPartition()->asBridge();
- if (bridge)
- {
- if (bridge->mAvatar.notNull())
- {
- bridge->mAvatar->subtractAttachmentArea(mSurfaceArea );
- }
- }
-
clearDrawMap();
mVertexBuffer = NULL;
mBufferMap.clear();
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 8e24962b11..a54a56008e 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -620,7 +620,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
LLViewerObject(id, pcode, regionp),
mSpecialRenderMode(0),
mAttachmentSurfaceArea(0.f),
- mDirectAttachmentSurfaceArea(0.f),
mAttachmentVisibleTriangleCount(0),
mAttachmentEstTriangleCount(0.f),
mReportedVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN),
@@ -7412,9 +7411,9 @@ bool LLVOAvatar::isTooComplex() const
// so that unlimited will completely disable the overly complex impostor rendering
// yes, this leaves them vulnerable to griefing objects... their choice
too_complex = ( max_render_cost > 0
- && ( mVisualComplexity > max_render_cost
- || (max_attachment_area > 0.0f && mAttachmentSurfaceArea > max_attachment_area)
- ));
+ && (mVisualComplexity > max_render_cost
+ || (max_attachment_area > 0.0f && mAttachmentSurfaceArea > max_attachment_area)
+ ));
}
return too_complex;
@@ -9312,10 +9311,7 @@ void LLVOAvatar::idleUpdateRenderComplexity()
// Attachment Surface Area
static LLCachedControl<F32> max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 1000.0f);
- // AXON we can consolidate mAttachmentSurfaceArea and
- // mDirectAttachmentSurfaceArea once QA establishes
- // equivalence.
- info_line = llformat("%.0f m^2", mDirectAttachmentSurfaceArea);
+ info_line = llformat("%.0f m^2", mAttachmentSurfaceArea);
if (max_render_cost != 0 && max_attachment_area != 0) // zero means don't care, so don't bother coloring based on this
{
@@ -9331,22 +9327,13 @@ void LLVOAvatar::idleUpdateRenderComplexity()
info_color.set(LLColor4::grey);
info_style = LLFontGL::NORMAL;
}
+
mText->addLine(info_line, info_color, info_style);
updateText(); // corrects position
}
}
-void LLVOAvatar::addAttachmentArea(F32 delta_area)
-{
- mAttachmentSurfaceArea += delta_area;
-}
-
-void LLVOAvatar::subtractAttachmentArea(F32 delta_area)
-{
- mAttachmentSurfaceArea = delta_area > mAttachmentSurfaceArea ? 0.0 : mAttachmentSurfaceArea - delta_area;
-}
-
void LLVOAvatar::updateVisualComplexity()
{
LL_DEBUGS("AvatarRender") << "avatar " << getID() << " appearance changed" << LL_ENDL;
@@ -9368,7 +9355,7 @@ void LLVOAvatar::accountRenderComplexityForObject(
{
mAttachmentVisibleTriangleCount += attached_object->recursiveGetTriangleCount();
mAttachmentEstTriangleCount += attached_object->recursiveGetEstTrianglesMax();
- mDirectAttachmentSurfaceArea += attached_object->recursiveGetScaledSurfaceArea();
+ mAttachmentSurfaceArea += attached_object->recursiveGetScaledSurfaceArea();
textures.clear();
const LLDrawable* drawable = attached_object->mDrawable;
@@ -9431,7 +9418,7 @@ void LLVOAvatar::accountRenderComplexityForObject(
{
textures.clear();
- mDirectAttachmentSurfaceArea += attached_object->recursiveGetScaledSurfaceArea();
+ mAttachmentSurfaceArea += attached_object->recursiveGetScaledSurfaceArea();
const LLVOVolume* volume = attached_object->mDrawable->getVOVolume();
if (volume)
@@ -9524,7 +9511,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity()
mAttachmentVisibleTriangleCount = 0;
mAttachmentEstTriangleCount = 0.f;
- mDirectAttachmentSurfaceArea = 0.f;
+ mAttachmentSurfaceArea = 0.f;
// A standalone animated object needs to be accounted for
// using its associated volume. Attached animated objects
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index f9a1d7b424..730373d79c 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -281,8 +281,6 @@ public:
U32 getVisualComplexity() { return mVisualComplexity; }; // Numbers calculated here by rendering AV
F32 getAttachmentSurfaceArea() { return mAttachmentSurfaceArea; }; // estimated surface area of attachments
- void addAttachmentArea(F32 delta_area);
- void subtractAttachmentArea(F32 delta_area);
U32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server
void setReportedVisualComplexity(U32 value) { mReportedVisualComplexity = value; };
@@ -438,7 +436,6 @@ public:
private:
F32 mAttachmentSurfaceArea; //estimated surface area of attachments
- F32 mDirectAttachmentSurfaceArea; //estimated surface area of attachments
U32 mAttachmentVisibleTriangleCount;
F32 mAttachmentEstTriangleCount;
bool shouldAlphaMask();
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 293c24ac4b..b12b503e78 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4923,7 +4923,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
group->mBuilt = 1.f;
LLVOAvatar *rigged_av = NULL;
- LLVOAvatar *attached_av = NULL;
LLSpatialBridge* bridge = group->getSpatialPartition()->asBridge();
LLViewerObject *vobj = NULL;
@@ -4942,19 +4941,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
}
rigged_av = bridge->mAvatar;
}
- if (vobj)
- {
- attached_av = vobj->getAvatarAncestor();
- }
-
- if (attached_av)
- {
- attached_av->subtractAttachmentArea( group->mSurfaceArea );
- }
- if (rigged_av && (rigged_av != attached_av))
- {
- rigged_av->subtractAttachmentArea( group->mSurfaceArea );
- }
if (vol_obj)
{
vol_obj->updateVisualComplexity();
@@ -5563,15 +5549,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
}
mFaceList.clear();
-
- if (attached_av)
- {
- attached_av->addAttachmentArea( group->mSurfaceArea );
- }
- if (rigged_av && (rigged_av != attached_av))
- {
- rigged_av->addAttachmentArea( group->mSurfaceArea );
- }
}
static LLTrace::BlockTimerStatHandle FTM_REBUILD_MESH_FLUSH("Flush Mesh");