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 | |
parent | 8c5bf1d0bac65053469888c27523e6bf30ee53cf (diff) |
Minor instrumentation tweaks -- add a couple of asserts, a timer, and fix VBO accounting.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappviewer.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llvopartgroup.cpp | 18 |
2 files changed, 20 insertions, 1 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4d94c90cc6..89994e505b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1133,6 +1133,8 @@ void LLAppViewer::checkMemory() static LLFastTimer::DeclareTimer FTM_MESSAGES("System Messages"); static LLFastTimer::DeclareTimer FTM_SLEEP("Sleep"); +static LLFastTimer::DeclareTimer FTM_YIELD("Yield"); + static LLFastTimer::DeclareTimer FTM_TEXTURE_CACHE("Texture Cache"); static LLFastTimer::DeclareTimer FTM_DECODE("Image Decode"); static LLFastTimer::DeclareTimer FTM_VFS("VFS Thread"); @@ -1318,6 +1320,7 @@ bool LLAppViewer::mainLoop() // yield some time to the os based on command line option if(mYieldTime >= 0) { + LLFastTimer t(FTM_YIELD); ms_sleep(mYieldTime); } 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) { |