From b9bb95f8ae085f0d9aa1ba0dc6866d44762ad67b Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 9 May 2013 15:40:02 -0500
Subject: MAINT-2647 Fix for some objects not rendering until first LoD
 switch/selection.

---
 indra/newview/lldrawable.cpp         | 2 +-
 indra/newview/lldrawable.h           | 1 -
 indra/newview/llviewerobject.cpp     | 3 ++-
 indra/newview/llviewerobjectlist.cpp | 3 ++-
 indra/newview/pipeline.cpp           | 5 -----
 5 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index bb1d263670..47306d3a6a 100755
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -441,7 +441,7 @@ void LLDrawable::makeActive()
 	}
 
 	llassert(isAvatar() || isRoot() || mParent->isActive());
-	}
+}
 
 
 void LLDrawable::makeStatic(BOOL warning_enabled)
diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h
index 4608d16fec..4420a34fae 100755
--- a/indra/newview/lldrawable.h
+++ b/indra/newview/lldrawable.h
@@ -284,7 +284,6 @@ public:
  		NEARBY_LIGHT	= 0x00200000, // In gPipeline.mNearbyLightSet
 		BUILT			= 0x00400000,
 		FORCE_INVISIBLE = 0x00800000, // stay invis until CLEAR_INVISIBLE is set (set of orphaned)
-		CLEAR_INVISIBLE = 0x01000000, // clear FORCE_INVISIBLE next draw frame
 		REBUILD_SHADOW =  0x02000000,
 		HAS_ALPHA		= 0x04000000,
 		RIGGED			= 0x08000000,
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 670272e7be..064e96e394 100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -2135,7 +2135,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 		if (mDrawable->isState(LLDrawable::FORCE_INVISIBLE) && !mOrphaned)
 		{
 // 			lldebugs << "Clearing force invisible: " << mID << ":" << getPCodeString() << ":" << getPositionAgent() << llendl;
-			mDrawable->setState(LLDrawable::CLEAR_INVISIBLE);
+			mDrawable->clearState(LLDrawable::FORCE_INVISIBLE);
+			gPipeline.markRebuild( mDrawable, LLDrawable::REBUILD_ALL, TRUE );
 		}
 	}
 
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 11d34ad084..caacf26cb3 100755
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -2065,8 +2065,9 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
 			if (childp->mDrawable.notNull())
 			{
 				// Make the drawable visible again and set the drawable parent
- 				childp->mDrawable->setState(LLDrawable::CLEAR_INVISIBLE);
+				childp->mDrawable->clearState(LLDrawable::FORCE_INVISIBLE);
 				childp->setDrawableParent(objectp->mDrawable); // LLViewerObjectList::findOrphans()
+				gPipeline.markRebuild( childp->mDrawable, LLDrawable::REBUILD_ALL, TRUE );
 			}
 
 			// Make certain particles, icon and HUD aren't hidden
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index f320f34f6e..7eed9acb4b 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -3306,11 +3306,6 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera)
 		{
 			drawablep->setVisible(camera, NULL, FALSE);
 		}
-		else if (drawablep->isState(LLDrawable::CLEAR_INVISIBLE))
-		{
-			// clear invisible flag here to avoid single frame glitch
-			drawablep->clearState(LLDrawable::FORCE_INVISIBLE|LLDrawable::CLEAR_INVISIBLE);
-		}
 	}
 
 	if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD)
-- 
cgit v1.2.3


From f6519afee0b9630e770905e90bb2896c8b49c20d Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Fri, 10 May 2013 12:56:21 -0400
Subject: tag merge of MAINT-2647

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 13da9a9bbb..d81c047c52 100755
--- a/.hgtags
+++ b/.hgtags
@@ -451,3 +451,4 @@ e6b8a92acffd693cd1459e4212e3dff1050acf67 DRTVWR-278
 cfc3e650e5b2063288e7b832e9c9f521bbdacc92 DRTVWR-315
 e6e35501f1fea252ef83080adcf30c3cb7c2f75c DRTVWR-299
 b6a4ac8f1916ede76e8a023e1cf35c045d0ac707 3.5.2-beta3
+1cfa86d604909dfdb8b372069ff61f9afaa2aac1 MAINT-2647
-- 
cgit v1.2.3


From 4dd245055f3417d8f8fb611a198ed5671dbce292 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Fri, 10 May 2013 14:44:52 -0400
Subject: Added tag 3.5.2-beta5 for changeset 895628bb5e16

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 59fe6ae784..8d28a72302 100755
--- a/.hgtags
+++ b/.hgtags
@@ -453,3 +453,4 @@ e6e35501f1fea252ef83080adcf30c3cb7c2f75c DRTVWR-299
 b6a4ac8f1916ede76e8a023e1cf35c045d0ac707 3.5.2-beta3
 a314f1c94374ab1f6633dd2983f7090a68663eb2 3.5.2-beta4
 1cfa86d604909dfdb8b372069ff61f9afaa2aac1 MAINT-2647
+895628bb5e162410cfdf4bca58f0a57d22ccfcde 3.5.2-beta5
-- 
cgit v1.2.3