diff options
author | Dave Parks <davep@lindenlab.com> | 2012-05-30 13:22:04 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2012-05-30 13:22:04 -0500 |
commit | 2e26dc3971f80fb177c53bc20c06798bbe4391a6 (patch) | |
tree | c6db21d792451e8ea1717cddbfecc2346cda53f4 /indra/newview/llvopartgroup.cpp | |
parent | 8c5bf1d0bac65053469888c27523e6bf30ee53cf (diff) |
Minor instrumentation tweaks -- add a couple of asserts, a timer, and fix VBO accounting.
Diffstat (limited to 'indra/newview/llvopartgroup.cpp')
-rw-r--r-- | indra/newview/llvopartgroup.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 1ac13cd1ea..e21358b65a 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -130,11 +130,27 @@ S32 LLVOPartGroup::findAvailableVBSlot() return ret; } +bool ll_is_part_idx_allocated(S32 idx, S32* start, S32* end) +{ + while (start < end) + { + if (*start == idx) + { //not allocated (in free list) + return false; + } + ++start; + } + + //allocated (not in free list) + return true; +} + //static void LLVOPartGroup::freeVBSlot(S32 idx) { llassert(idx < LL_MAX_PARTICLE_COUNT && idx >= 0); - //llassert(sVBSlotCursor > sVBSlotFree); + llassert(sVBSlotCursor > sVBSlotFree); + llassert(ll_is_part_idx_allocated(idx, sVBSlotCursor, sVBSlotFree+LL_MAX_PARTICLE_COUNT)); if (sVBSlotCursor > sVBSlotFree) { |