From dceab3c78bb49eab28d1307bb7544e4b2b7763f0 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 8 Sep 2020 21:41:53 +0300 Subject: SL-3278 Compensate for randomly-switching textures --- indra/newview/llvovolume.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 98eb2d3cdc..4799fb467f 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3972,7 +3972,25 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const { if (textures.find(img->getID()) == textures.end()) { - S32 texture_cost = 256 + (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f)); + S32 texture_cost = 0; + S8 type = img->getType(); + if (type == LLViewerTexture::FETCHED_TEXTURE || type == LLViewerTexture::LOD_TEXTURE) + { + const LLViewerFetchedTexture* fetched_texturep = dynamic_cast(img); + if (fetched_texturep + && fetched_texturep->getFTType() == FTT_LOCAL_FILE + && (img->getID() == IMG_ALPHA_GRAD_2D || img->getID() == IMG_ALPHA_GRAD) + ) + { + // These two textures appear to switch between each other, but are of different sizes (4x256 and 256x256). + // Hardcode cost from larger one to not cause random complexity changes + texture_cost = 320; + } + } + if (texture_cost == 0) + { + texture_cost = 256 + (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f)); + } textures.insert(texture_cost_t::value_type(img->getID(), texture_cost)); } } -- 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/llvovolume.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 From 531349a2fef9476d7afb12e7b5efa8e984e11000 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 21 Sep 2020 14:26:27 +0300 Subject: SL-13729 Small fix with some cached settings --- indra/newview/llvovolume.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e23b54f60c..93062b7a2e 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5429,8 +5429,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) U32 useage = group->getSpatialPartition()->mBufferUsage; - LLCachedControl max_vbo_size(gSavedSettings, "RenderMaxVBOSize", 512); - LLCachedControl max_node_size(gSavedSettings, "RenderMaxNodeSize", 65536); + static LLCachedControl max_vbo_size(gSavedSettings, "RenderMaxVBOSize", 512); + static LLCachedControl max_node_size(gSavedSettings, "RenderMaxNodeSize", 65536); U32 max_vertices = (max_vbo_size * 1024)/LLVertexBuffer::calcVertexSize(group->getSpatialPartition()->mVertexDataMask); U32 max_total = (max_node_size * 1024) / LLVertexBuffer::calcVertexSize(group->getSpatialPartition()->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); @@ -6195,7 +6195,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace #endif //calculate maximum number of vertices to store in a single buffer - LLCachedControl max_vbo_size(gSavedSettings, "RenderMaxVBOSize", 512); + static LLCachedControl max_vbo_size(gSavedSettings, "RenderMaxVBOSize", 512); U32 max_vertices = (max_vbo_size * 1024)/LLVertexBuffer::calcVertexSize(group->getSpatialPartition()->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); -- cgit v1.3