diff options
author | Brad Kittenbrink <brad@lindenlab.com> | 2022-10-26 11:45:38 -0700 |
---|---|---|
committer | Brad Kittenbrink <brad@lindenlab.com> | 2022-10-26 11:45:38 -0700 |
commit | 1dad0f8eb863381536dfb5094d7dacc9b445d543 (patch) | |
tree | 3c5f8faa00dd41a6330d4c6f9904015d41ad96eb /indra | |
parent | d69c814db94c907a1a772e4e63a8b82a293985d2 (diff) | |
parent | a022452ff56c31cb028d5a17d827c82f1a74e624 (diff) |
Merge remote-tracking branch 'origin/master' into DRTVWR-559
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llspatialpartition.h | 2 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 51 |
2 files changed, 8 insertions, 45 deletions
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index a0c24ca7dc..0d16b818f1 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -274,7 +274,7 @@ public: 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 8415d457df..663dd2d9ec 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5705,7 +5705,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; } } @@ -5713,36 +5713,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; @@ -5908,8 +5884,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(); @@ -5930,9 +5904,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) continue; } - // order by linkset index first and face index second - facep->setDrawOrderIndex(linkset_index * 100 + i); - // HACK -- brute force this check every time a drawable gets rebuilt vobj->updateTEMaterialTextures(i); #if 0 @@ -5972,6 +5943,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; @@ -6441,14 +6417,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; @@ -6482,11 +6450,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) { |