summaryrefslogtreecommitdiff
path: root/indra/newview/llspatialpartition.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-01-08 21:33:06 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-01-08 21:33:06 +0200
commitafe91b7eb68da65687beef451bd094ff0091b717 (patch)
tree5bdb9e5b5a78a16a8c1362c33717a6931fb40458 /indra/newview/llspatialpartition.cpp
parent6e6df8c31e09e6ba69156150ecd37cc4ac4ea0e6 (diff)
parent77395eddc911e0801e50fd693f7bbaee8046aa95 (diff)
Merge main (DRTVWR-596 GLTF Materials Maint) into DRTVWR-591-maint-X
# Conflicts: # indra/newview/VIEWER_VERSION.txt
Diffstat (limited to 'indra/newview/llspatialpartition.cpp')
-rw-r--r--indra/newview/llspatialpartition.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index e5fdfca7d5..2ecdf75e29 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -64,6 +64,9 @@ bool LLSpatialGroup::sNoDelete = false;
static F32 sLastMaxTexPriority = 1.f;
static F32 sCurMaxTexPriority = 1.f;
+// enable expensive sanity checks around redundant drawable and group insertion to LLCullResult
+#define LL_DEBUG_CULL_RESULT 0
+
//static counter for frame to switch LOD on
void sg_assert(BOOL expr)
@@ -4050,6 +4053,10 @@ void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group)
void LLCullResult::pushDrawableGroup(LLSpatialGroup* group)
{
+#if LL_DEBUG_CULL_RESULT
+ // group must NOT be in the drawble groups list already
+ llassert(std::find(&mDrawableGroups[0], mDrawableGroupsEnd, group) == mDrawableGroupsEnd);
+#endif
if (mDrawableGroupsSize < mDrawableGroupsAllocated)
{
mDrawableGroups[mDrawableGroupsSize] = group;
@@ -4064,6 +4071,10 @@ void LLCullResult::pushDrawableGroup(LLSpatialGroup* group)
void LLCullResult::pushDrawable(LLDrawable* drawable)
{
+#if LL_DEBUG_CULL_RESULT
+ // drawable must NOT be in the visible list already
+ llassert(std::find(&mVisibleList[0], mVisibleListEnd, drawable) == mVisibleListEnd);
+#endif
if (mVisibleListSize < mVisibleListAllocated)
{
mVisibleList[mVisibleListSize] = drawable;