summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-03-24 14:48:06 -0500
committerDave Parks <davep@lindenlab.com>2022-03-24 14:48:06 -0500
commit41cf9fcb050b682ea8f9a855da33a246b5e169c4 (patch)
tree67d35741cb149885d30d17191a447307290cfc95 /indra/newview/llvovolume.cpp
parent1d79d101ecaa0a4b365e7f28ca022c1e19a43108 (diff)
SL-17028 Fix for inconsistent ordering of transparent rigged meshes and removal of glow-only rigged meshes from depth buffer.
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp45
1 files changed, 19 insertions, 26 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index f8728a5ab7..f18f6b1116 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -5467,6 +5467,7 @@ static inline void add_face(T*** list, U32* count, T* face)
{
if (count[1] < MAX_FACE_COUNT)
{
+ face->setDrawOrderIndex(count[1]);
list[1][count[1]++] = face;
}
}
@@ -5474,6 +5475,7 @@ static inline void add_face(T*** list, U32* count, T* face)
{
if (count[0] < MAX_FACE_COUNT)
{
+ face->setDrawOrderIndex(count[0]);
list[0][count[0]++] = face;
}
}
@@ -6088,7 +6090,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
}
}
-struct CompareBatchBreakerModified
+struct CompareBatchBreaker
{
bool operator()(const LLFace* const& lhs, const LLFace* const& rhs)
{
@@ -6103,18 +6105,23 @@ struct CompareBatchBreakerModified
{
return lte->getFullbright() < rte->getFullbright();
}
- else if (LLPipeline::sRenderDeferred && lte->getMaterialParams() != rte->getMaterialParams())
- {
- return lte->getMaterialParams() < rte->getMaterialParams();
- }
- else if (LLPipeline::sRenderDeferred && (lte->getMaterialParams() == rte->getMaterialParams()) && (lte->getShiny() != rte->getShiny()))
+ else if (LLPipeline::sRenderDeferred && lte->getMaterialID() != rte->getMaterialID())
+ {
+ return lte->getMaterialID() < rte->getMaterialID();
+ }
+ else if (lte->getShiny() != rte->getShiny())
{
return lte->getShiny() < rte->getShiny();
}
- else
+ else if (lhs->getTexture() != rhs->getTexture())
{
return lhs->getTexture() < rhs->getTexture();
}
+ else
+ {
+ // all else being equal, maintain consistent draw order
+ return lhs->getDrawOrderIndex() < rhs->getDrawOrderIndex();
+ }
}
};
@@ -6122,9 +6129,6 @@ struct CompareBatchBreakerRigged
{
bool operator()(const LLFace* const& lhs, const LLFace* const& rhs)
{
- const LLTextureEntry* lte = lhs->getTextureEntry();
- const LLTextureEntry* rte = rhs->getTextureEntry();
-
if (lhs->mAvatar != rhs->mAvatar)
{
return lhs->mAvatar < rhs->mAvatar;
@@ -6133,23 +6137,12 @@ struct CompareBatchBreakerRigged
{
return lhs->mSkinInfo->mHash < rhs->mSkinInfo->mHash;
}
- else if (lhs->getTexture() != rhs->getTexture())
- {
- return lhs->getTexture() < rhs->getTexture();
- }
- else if (lte->getBumpmap() != rte->getBumpmap())
- {
- return lte->getBumpmap() < rte->getBumpmap();
- }
- else if (LLPipeline::sRenderDeferred && lte->getMaterialID() != rte->getMaterialID())
- {
- return lte->getMaterialID() < rte->getMaterialID();
- }
- else // if (LLPipeline::sRenderDeferred && (lte->getMaterialParams() == rte->getMaterialParams()) && (lte->getShiny() != rte->getShiny()))
+ else
{
- return lte->getShiny() < rte->getShiny();
+ // "inherit" non-rigged behavior
+ CompareBatchBreaker comp;
+ return comp(lhs, rhs);
}
-
}
};
@@ -6198,7 +6191,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
else if (!distance_sort)
{
//sort faces by things that break batches, not including avatar and mesh id
- std::sort(faces, faces + face_count, CompareBatchBreakerModified());
+ std::sort(faces, faces + face_count, CompareBatchBreaker());
}
else
{