diff options
Diffstat (limited to 'indra/newview/llspatialpartition.cpp')
-rw-r--r-- | indra/newview/llspatialpartition.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index f2c1b803b8..faf6f15015 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) @@ -4041,6 +4044,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; @@ -4055,6 +4062,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; |