Avatar and Rig NSIGHT instrumentation

This commit is contained in:
Anthony Thibault 2016-03-22 10:36:00 -07:00
parent 9faccabf0d
commit 50ac101d56
2 changed files with 15 additions and 4 deletions

View file

@ -3245,6 +3245,8 @@ void Application::update(float deltaTime) {
PerformanceTimer perfTimer("physics");
{
PROFILE_RANGE_EX("UpdateStats", 0xffffff00, (uint64_t)getActiveDisplayPlugin()->presentCount());
PerformanceTimer perfTimer("updateStates)");
static VectorOfMotionStates motionStates;
_entitySimulation.getObjectsToRemoveFromPhysics(motionStates);
@ -3277,12 +3279,14 @@ void Application::update(float deltaTime) {
});
}
{
PROFILE_RANGE_EX("StepSimulation", 0xffff8000, (uint64_t)getActiveDisplayPlugin()->presentCount());
PerformanceTimer perfTimer("stepSimulation");
getEntities()->getTree()->withWriteLock([&] {
_physicsEngine->stepSimulation();
});
}
{
PROFILE_RANGE_EX("HarvestChanges", 0xffffff00, (uint64_t)getActiveDisplayPlugin()->presentCount());
PerformanceTimer perfTimer("havestChanges");
if (_physicsEngine->hasOutgoingChanges()) {
getEntities()->getTree()->withWriteLock([&] {
@ -3313,17 +3317,21 @@ void Application::update(float deltaTime) {
// AvatarManager update
{
PROFILE_RANGE_EX("Avatars", 0xffff0000, (uint64_t)getActiveDisplayPlugin()->presentCount());
PerformanceTimer perfTimer("AvatarManger");
qApp->setAvatarSimrateSample(1.0f / deltaTime);
avatarManager->updateOtherAvatars(deltaTime);
{
PROFILE_RANGE_EX("OtherAvatars", 0xffff00ff, (uint64_t)getActiveDisplayPlugin()->presentCount());
avatarManager->updateOtherAvatars(deltaTime);
}
qApp->updateMyAvatarLookAtPosition();
avatarManager->updateMyAvatar(deltaTime);
{
PROFILE_RANGE_EX("MyAvatar", 0xffff00ff, (uint64_t)getActiveDisplayPlugin()->presentCount());
avatarManager->updateMyAvatar(deltaTime);
}
}
{

View file

@ -20,6 +20,7 @@
#include <GeometryUtil.h>
#include <NumericalConstants.h>
#include <DebugDraw.h>
#include <shared/NsightHelpers.h>
#include "AnimationLogging.h"
#include "AnimClip.h"
@ -852,6 +853,8 @@ void Rig::updateAnimationStateHandlers() { // called on avatar update thread (wh
void Rig::updateAnimations(float deltaTime, glm::mat4 rootTransform) {
PROFILE_RANGE_EX(__FUNCTION__, 0xffff00ff, 0);
setModelOffset(rootTransform);
if (_animNode) {