diff --git a/doc/contributions.txt b/doc/contributions.txt
index a693c22abcfe0a48bbf0c35e36f039b3890d6645..9368781c9a6cc27e81d9a2a3b4830da743a261eb 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -236,6 +236,7 @@ Ansariel Hiller
 	SL-15226
 	SL-15227
 	SL-15398
+	SL-18432
 Aralara Rajal
 Arare Chantilly
 	CHUIBUG-191
diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt
index 5dbe61b99e3af9e5cdf98c931205e4e3e5ddeabe..10abd6ae5bd33cde5868f5e6e3009b3fc451f215 100644
--- a/indra/newview/VIEWER_VERSION.txt
+++ b/indra/newview/VIEWER_VERSION.txt
@@ -1 +1 @@
-6.6.5
+6.6.6
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h
index 1b82b37682a3f4cfa6b05a58685e899d26e2f18f..5544a99fac45e0eee3ed7aefaad3df8fad5834e0 100644
--- a/indra/newview/llspatialpartition.h
+++ b/indra/newview/llspatialpartition.h
@@ -266,7 +266,7 @@ class LLSpatialGroup final : public LLOcclusionCullingGroup
                 return lhs->mAvatarp < rhs->mAvatarp;
             }
 
-            return lhs->mRenderOrder < rhs->mRenderOrder;
+            return lhs->mRenderOrder > rhs->mRenderOrder;
         }
     };
 
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 260adcb42dc251c1b4ae33f71636820a7c3b4ba8..c22446e6caa0f8a90e4b3aff503ae38a5241a1e8 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -5550,7 +5550,7 @@ static inline void add_face(T*** list, U32* count, T* face)
     {
         if (count[1] < MAX_FACE_COUNT)
         {
-            //face->setDrawOrderIndex(count[1]);
+            face->setDrawOrderIndex(count[1]);
             list[1][count[1]++] = face;
         }
     }
@@ -5558,36 +5558,12 @@ static inline void add_face(T*** list, U32* count, T* face)
     {
         if (count[0] < MAX_FACE_COUNT)
         {
-            //face->setDrawOrderIndex(count[0]);
+            face->setDrawOrderIndex(count[0]);
             list[0][count[0]++] = face;
         }
     }
 }
 
-// return index into linkset for given object (0 for root prim)
-U32 get_linkset_index(LLVOVolume* vobj)
-{
-    LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE;
-    if (vobj->isRootEdit())
-    {
-        return 0;
-    }
-
-    LLViewerObject* root = vobj->getRootEdit();
-    U32 idx = 1;
-    for (const auto& child : root->getChildren())
-    {
-        if (child == vobj)
-        {
-            return idx;
-        }
-        ++idx;
-    }
-
-    llassert(false);
-    return idx; //should never get here
-}
-
 void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 {
     LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
@@ -5735,8 +5711,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
             {
                 avatar->addAttachmentOverridesForObject(vobj, NULL, false);
             }
-            
-            U32 linkset_index = get_linkset_index(vobj);
 
             // Standard rigged mesh attachments: 
 			bool rigged = !vobj->isAnimatedObject() && skinInfo && vobj->isAttachment();
@@ -5757,9 +5731,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 					continue;
 				}
 
-                // order by linkset index first and face index second
-                facep->setDrawOrderIndex(linkset_index * 100 + i);
-
 				//ALWAYS null out vertex buffer on rebuild -- if the face lands in a render
 				// batch, it will recover its vertex buffer reference from the spatial group
 				facep->setVertexBuffer(NULL);
@@ -5784,6 +5755,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
                     if (facep->isState(LLFace::RIGGED))
                     { 
                         //face is not rigged but used to be, remove from rigged face pool
+                        LLDrawPoolAvatar* pool = (LLDrawPoolAvatar*)facep->getPool();
+                        if (pool)
+                        {
+                            pool->removeFace(facep);
+                        }
                         facep->clearState(LLFace::RIGGED);
                         facep->mAvatar = NULL;
                         facep->mSkinInfo = NULL;
@@ -6240,14 +6216,6 @@ struct CompareBatchBreakerRigged
     }
 };
 
-struct CompareDrawOrder
-{
-    bool operator()(const LLFace* const& lhs, const LLFace* const& rhs)
-    {
-        return lhs->getDrawOrderIndex() < rhs->getDrawOrderIndex();
-    }
-};
-
 U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace** faces, U32 face_count, BOOL distance_sort, BOOL batch_textures, BOOL rigged)
 {
     LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
@@ -6281,11 +6249,6 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
                 //sort faces by things that break batches, including avatar and mesh id
                 std::sort(faces, faces + face_count, CompareBatchBreakerRigged());
             }
-            else
-            {
-                // preserve legacy draw order for rigged faces
-                std::sort(faces, faces + face_count, CompareDrawOrder());
-            }
         }
         else if (!distance_sort)
         {