From eec58c993f50f23a0257981e91fa2607bddd7a08 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Wed, 21 Oct 2020 03:01:58 -0400
Subject: [PATCH] Small optimization from BD/Niran

---
 indra/newview/lldrawpoolavatar.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 753d287c103..f760ab17c6a 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -2066,6 +2066,13 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
 		{
 			continue;
 		}
+		const LLTextureEntry* tex_entry = face->getTextureEntry();
+
+		// Don't render invisible faces even when they are in a linkset.
+		if (tex_entry && tex_entry->getColor().mV[VW] == 0.0f)
+		{
+			continue;
+		}
 
 		//stop_glerror();
 
@@ -2078,7 +2085,6 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
 
 		LLVertexBuffer* buff = face->getVertexBuffer();
 
-        const LLTextureEntry* tex_entry = face->getTextureEntry();
 		LLMaterial* mat = tex_entry ? tex_entry->getMaterialParams().get() : nullptr;
 
         if (LLDrawPoolAvatar::sShadowPass >= 0)
-- 
GitLab