From 320dfa1d72c2eab9c59daf6bb13cc5001162c7b0 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Thu, 19 Nov 2009 15:01:27 -0800 Subject: Added LLVOVolume::markDead(), which unhooks any prim media instances from the dead object. --- indra/newview/llvovolume.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e5531a1497..8bfbfcb9c3 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -183,6 +183,22 @@ LLVOVolume::~LLVOVolume() } } +void LLVOVolume::markDead() +{ + if (!mDead) + { + // TODO: tell LLMediaDataClient to remove this object from its queue + + // Detach all media impls from this object + for(U32 i = 0 ; i < mMediaImplList.size() ; i++) + { + removeMediaImpl(i); + } + } + + LLViewerObject::markDead(); +} + // static void LLVOVolume::initClass() @@ -1708,6 +1724,12 @@ void LLVOVolume::updateObjectMediaData(const LLSD &media_data_array) void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool merge, bool ignore_agent) { + if(mDead) + { + // If the object has been marked dead, don't process media updates. + return; + } + LLTextureEntry *te = getTE(texture_index); //llinfos << "BEFORE: texture_index = " << texture_index // << " hasMedia = " << te->hasMedia() << " : " -- cgit v1.2.3 From ba3f7965e35e4eb0d7fcecc7267ec3af5f2d8d87 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Thu, 19 Nov 2009 16:35:11 -0800 Subject: Made LLMediaDataClient not send requests on behalf of objects that are marked as dead. When LLMediaDataClient::QueueTimer::tick() encounters an object at the head of the queue that's dead, it will now remove that object and loop, instead of sending a request and waiting for the tick timer to fire again. Added an isDead() function to LLMediaDataClientObject, and an additional unit test that verifies the handling of dead objects. --- indra/newview/llvovolume.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8bfbfcb9c3..5a67e64bbd 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -140,6 +140,9 @@ public: virtual std::string getCapabilityUrl(const std::string &name) const { return mObject->getRegion()->getCapability(name); } + virtual bool isDead() const + { return mObject->isDead(); } + private: LLPointer mObject; }; -- cgit v1.2.3 From 3bb86f91bc345f74057debe1f8f680098895a40e Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 20 Nov 2009 14:01:49 -0800 Subject: Clean up some logging --- indra/newview/llvovolume.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 5a67e64bbd..428af5380c 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1734,9 +1734,9 @@ void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool m } LLTextureEntry *te = getTE(texture_index); - //llinfos << "BEFORE: texture_index = " << texture_index - // << " hasMedia = " << te->hasMedia() << " : " - // << ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl; + LL_DEBUGS("MediaOnAPrim") << "BEFORE: texture_index = " << texture_index + << " hasMedia = " << te->hasMedia() << " : " + << ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl; std::string previous_url; LLMediaEntry* mep = te->getMediaData(); @@ -1776,9 +1776,9 @@ void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool m removeMediaImpl(texture_index); } - //llinfos << "AFTER: texture_index = " << texture_index - // << " hasMedia = " << te->hasMedia() << " : " - // << ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl; + LL_DEBUGS("MediaOnAPrim") << "AFTER: texture_index = " << texture_index + << " hasMedia = " << te->hasMedia() << " : " + << ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl; } void LLVOVolume::mediaNavigateBounceBack(U8 texture_index) @@ -1801,7 +1801,7 @@ void LLVOVolume::mediaNavigateBounceBack(U8 texture_index) } if (! url.empty()) { - LL_INFOS("LLMediaDataClient") << "bouncing back to URL: " << url << LL_ENDL; + LL_INFOS("MediaOnAPrim") << "bouncing back to URL: " << url << LL_ENDL; impl->navigateTo(url, "", false, true); } } -- cgit v1.2.3 From ca5e49d5fab171bc455c58b8f745d7f00d46bb41 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 23 Nov 2009 15:12:48 -0500 Subject: EXT-2718 EXT-2434 avatar render cost changes Fixing a but in new ARC function where textures added 5 to the ARC for each use. Expected (and previous) behavior restored, where 5 is added to ARC for each unique texture, regardless of how many faces it is used on. Confirmed new ARC is 99 points higher than previous (20 for each body part), or 119 if avatar is wearing a skirt. Will be post-reviewed before pushing --HG-- branch : avatar-pipeline --- indra/newview/llvovolume.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvovolume.cpp') 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 &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); } } } -- cgit v1.2.3