reapply 230c111ab816: Add some timers.

master
Dave Parks 2012-09-20 09:48:53 -04:00
parent 5c3c556e94
commit 9bf49903ed
4 changed files with 32 additions and 5 deletions

View File

@ -189,6 +189,7 @@ void LLCharacter::requestStopMotion( LLMotion* motion)
//-----------------------------------------------------------------------------
static LLFastTimer::DeclareTimer FTM_UPDATE_ANIMATION("Update Animation");
static LLFastTimer::DeclareTimer FTM_UPDATE_HIDDEN_ANIMATION("Update Hidden Anim");
static LLFastTimer::DeclareTimer FTM_UPDATE_MOTIONS("Update Motions");
void LLCharacter::updateMotions(e_update_t update_type)
{
@ -206,7 +207,10 @@ void LLCharacter::updateMotions(e_update_t update_type)
mMotionController.unpauseAllMotions();
}
bool force_update = (update_type == FORCE_UPDATE);
mMotionController.updateMotions(force_update);
{
LLFastTimer t(FTM_UPDATE_MOTIONS);
mMotionController.updateMotions(force_update);
}
}
}

View File

@ -158,11 +158,14 @@ BOOL LLEditingMotion::onActivate()
return TRUE;
}
static LLFastTimer::DeclareTimer FTM_EDITING_MOTION("Editing Motion");
//-----------------------------------------------------------------------------
// LLEditingMotion::onUpdate()
//-----------------------------------------------------------------------------
BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
{
LLFastTimer t(FTM_EDITING_MOTION);
LLVector3 focus_pt;
LLVector3* pointAtPt = (LLVector3*)mCharacter->getAnimationData("PointAtPoint");

View File

@ -196,11 +196,15 @@ BOOL LLWalkAdjustMotion::onActivate()
return TRUE;
}
static LLFastTimer::DeclareTimer FTM_WALK_ADJUST_MOTION("Walk Adjust");
//-----------------------------------------------------------------------------
// LLWalkAdjustMotion::onUpdate()
//-----------------------------------------------------------------------------
BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
{
LLFastTimer t(FTM_WALK_ADJUST_MOTION);
// delta_time is guaranteed to be non zero
F32 delta_time = llclamp(time - mLastTime, TIME_EPSILON, MAX_TIME_DELTA);
mLastTime = time;

View File

@ -539,11 +539,14 @@ void LLMotionController::updateIdleActiveMotions()
}
}
static LLFastTimer::DeclareTimer FTM_UPDATE_MOTIONS_BY_TYPE("Update Motions By Type");
//-----------------------------------------------------------------------------
// updateMotionsByType()
//-----------------------------------------------------------------------------
void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type)
{
LLFastTimer t(FTM_UPDATE_MOTIONS_BY_TYPE);
BOOL update_result = TRUE;
U8 last_joint_signature[LL_CHARACTER_MAX_JOINTS];
@ -795,6 +798,9 @@ void LLMotionController::updateLoadingMotions()
// call updateMotion() or updateMotionsMinimal() every frame
//-----------------------------------------------------------------------------
static LLFastTimer::DeclareTimer FTM_UPDATE_MOTION_PURGE_EXCESS("Purge Excess Motions");
static LLFastTimer::DeclareTimer FTM_UPDATE_LOADING_MOTIONS("Update Loading Motions");
//-----------------------------------------------------------------------------
// updateMotion()
//-----------------------------------------------------------------------------
@ -808,8 +814,11 @@ void LLMotionController::updateMotions(bool force_update)
mPrevTimerElapsed = cur_time;
mLastTime = mAnimTime;
// Always cap the number of loaded motions
purgeExcessMotions();
{
LLFastTimer t(FTM_UPDATE_MOTION_PURGE_EXCESS);
// Always cap the number of loaded motions
purgeExcessMotions();
}
// Update timing info for this time step.
if (!mPaused)
@ -831,7 +840,11 @@ void LLMotionController::updateMotions(bool force_update)
mLastInterp = interp;
}
updateLoadingMotions();
{
LLFastTimer t(FTM_UPDATE_LOADING_MOTIONS);
updateLoadingMotions();
}
return;
}
@ -849,7 +862,10 @@ void LLMotionController::updateMotions(bool force_update)
}
}
updateLoadingMotions();
{
LLFastTimer t(FTM_UPDATE_LOADING_MOTIONS);
updateLoadingMotions();
}
resetJointSignatures();