summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-11-24 12:00:45 -0500
committerLoren Shih <seraph@lindenlab.com>2009-11-24 12:00:45 -0500
commit0904cbe4846192c9897267c9a60175f84881f9ed (patch)
tree831bb035d1bb48edb8014d50394dd5148a578322 /indra/newview/llvovolume.cpp
parente11d1c1d2b437b7b6d8ba0d0514f050b5d60b221 (diff)
parent8eb62aef06bc670ed758c605e6308ff700978a33 (diff)
merge
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index e5531a1497..1f49cd30c7 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -2541,7 +2541,11 @@ const LLMatrix4 LLVOVolume::getRenderMatrix() const
return mDrawable->getWorldMatrix();
}
-U32 LLVOVolume::getRenderCost() const
+// Returns a base cost and adds textures to passed in set.
+// total cost is returned value + 5 * size of the resulting set.
+// Cannot include cost of textures, as they may be re-used in linked
+// children, and cost should only be increased for unique textures -Nyx
+U32 LLVOVolume::getRenderCost(std::set<LLUUID> &textures) const
{
U32 shame = 0;
@@ -2574,7 +2578,7 @@ U32 LLVOVolume::getRenderCost() const
{
const LLSculptParams *sculpt_params = (LLSculptParams *) getParameterEntry(LLNetworkData::PARAMS_SCULPT);
LLUUID sculpt_id = sculpt_params->getSculptTexture();
- shame += 5;
+ textures.insert(sculpt_id);
}
for (S32 i = 0; i < drawablep->getNumFaces(); ++i)
@@ -2583,7 +2587,7 @@ U32 LLVOVolume::getRenderCost() const
const LLTextureEntry* te = face->getTextureEntry();
const LLViewerTexture* img = face->getTexture();
- shame += 5;
+ textures.insert(img->getID());
if (face->getPoolType() == LLDrawPool::POOL_ALPHA)
{
@@ -2633,7 +2637,7 @@ U32 LLVOVolume::getRenderCost() const
const LLVOVolume* child_volumep = child_drawablep->getVOVolume();
if (child_volumep)
{
- shame += child_volumep->getRenderCost();
+ shame += child_volumep->getRenderCost(textures);
}
}
}