From 6f16e6c4e0836353cb1a8d2c356abe4de78d315a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 7 Sep 2020 23:23:17 +0300 Subject: SL-3278 Wrap debug code into debug option --- indra/newview/llvoavatar.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d567623ac0..c5ae80dca3 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -10432,8 +10432,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() // Diagnostic output to identify all avatar-related textures. // Does not affect rendering cost calculation. - // Could be wrapped in a debug option if output becomes problematic. - if (isSelf()) + if (isSelf() && debugLoggingEnabled("ARCdetail")) { // print any attachment textures we didn't already know about. for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it) -- cgit v1.3 From 76ee89fb50e394bdaa1cfc85d57d76666beca7fb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 8 Sep 2020 21:30:54 +0300 Subject: SL-3278 Parts unique to 'self' should not affect render complexity --- indra/newview/llvoavatar.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c5ae80dca3..8cc0cc174c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -10388,10 +10388,23 @@ void LLVOAvatar::calculateUpdateRenderComplexity() ETextureIndex tex_index = baked_dict->mTextureIndex; if ((tex_index != TEX_SKIRT_BAKED) || (isWearingWearableType(LLWearableType::WT_SKIRT))) { - if (isTextureVisible(tex_index)) - { - cost +=COMPLEXITY_BODY_PART_COST; - } + // Same as isTextureVisible(), but doesn't account for isSelf to ensure identical numbers for all avatars + if (isIndexLocalTexture(tex_index)) + { + if (isTextureDefined(tex_index, 0)) + { + cost += COMPLEXITY_BODY_PART_COST; + } + } + else + { + // baked textures can use TE images directly + if (isTextureDefined(tex_index) + && (getTEImage(tex_index)->getID() != IMG_INVISIBLE || LLDrawPoolAlpha::sShowDebugAlpha)) + { + cost += COMPLEXITY_BODY_PART_COST; + } + } } } LL_DEBUGS("ARCdetail") << "Avatar body parts complexity: " << cost << LL_ENDL; -- cgit v1.3 From 45758daa8a1f388f5881f5025063e13b10ff7721 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 9 Sep 2020 15:21:27 +0300 Subject: SL-3278 Small adjustement --- indra/newview/llvoavatar.cpp | 3 ++- indra/newview/llvovolume.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8cc0cc174c..2587967d15 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -10288,7 +10288,8 @@ void LLVOAvatar::accountRenderComplexityForObject( LL_DEBUGS("ARCdetail") << "Attachment costs " << attached_object->getAttachmentItemID() << " total: " << attachment_total_cost << ", volume: " << attachment_volume_cost - << ", textures: " << attachment_texture_cost + << ", " << textures.size() + << " textures: " << attachment_texture_cost << ", " << volume->numChildren() << " children: " << attachment_children_cost << LL_ENDL; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 4799fb467f..e23b54f60c 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3976,7 +3976,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const S8 type = img->getType(); if (type == LLViewerTexture::FETCHED_TEXTURE || type == LLViewerTexture::LOD_TEXTURE) { - const LLViewerFetchedTexture* fetched_texturep = dynamic_cast(img); + const LLViewerFetchedTexture* fetched_texturep = static_cast(img); if (fetched_texturep && fetched_texturep->getFTType() == FTT_LOCAL_FILE && (img->getID() == IMG_ALPHA_GRAD_2D || img->getID() == IMG_ALPHA_GRAD) -- cgit v1.3