Cleanup names of debug stats and trace contexts.
Showing the changes to interface/src/Application.cpp (1 of 18 files). Show all
Unified · Split
| @@ -3222,8 +3222,6 @@ void Application::keyPressEvent(QKeyEvent* event) { · 3221 unmodified lines | ||
| 3222 | 3222 | } |
| 3223 | 3223 | } |
| 3224 | 3224 | |
| 3225 | − | |
| 3226 | − | |
| 3227 | 3225 | void Application::keyReleaseEvent(QKeyEvent* event) { |
| 3228 | 3226 | _keysPressed.remove(event->key()); |
| 3229 | 3227 | |
| @@ -4848,8 +4846,7 @@ void Application::update(float deltaTime) { · 1618 unmodified lines | ||
| 4848 | 4846 | if (_physicsEnabled) { |
| 4849 | 4847 | { |
| 4850 | 4848 | PROFILE_RANGE(simulation_physics, "PreStep"); |
| 4851 | − | |
| 4852 | − PerformanceTimer perfTimer("updateStates)"); | |
| 4849 | + PerformanceTimer perfTimer("preStep)"); | |
| 4853 | 4850 | static VectorOfMotionStates motionStates; |
| 4854 | 4851 | _entitySimulation->getObjectsToRemoveFromPhysics(motionStates); |
| 4855 | 4852 | _physicsEngine->removeObjects(motionStates); |
| @@ -4882,22 +4879,22 @@ void Application::update(float deltaTime) { · 26 unmodified lines | ||
| 4882 | 4879 | } |
| 4883 | 4880 | { |
| 4884 | 4881 | PROFILE_RANGE(simulation_physics, "Step"); |
| 4885 | − PerformanceTimer perfTimer("stepSimulation"); | |
| 4882 | + PerformanceTimer perfTimer("step"); | |
| 4886 | 4883 | getEntities()->getTree()->withWriteLock([&] { |
| 4887 | 4884 | _physicsEngine->stepSimulation(); |
| 4888 | 4885 | }); |
| 4889 | 4886 | } |
| 4890 | 4887 | { |
| 4891 | 4888 | PROFILE_RANGE(simulation_physics, "PostStep"); |
| 4892 | − PerformanceTimer perfTimer("harvestChanges"); | |
| 4889 | + PerformanceTimer perfTimer("postStep"); | |
| 4893 | 4890 | if (_physicsEngine->hasOutgoingChanges()) { |
| 4894 | 4891 | // grab the collision events BEFORE handleOutgoingChanges() because at this point |
| 4895 | 4892 | // we have a better idea of which objects we own or should own. |
| 4896 | 4893 | auto& collisionEvents = _physicsEngine->getCollisionEvents(); |
| 4897 | 4894 | |
| 4898 | 4895 | getEntities()->getTree()->withWriteLock([&] { |
| 4899 | − PROFILE_RANGE(simulation_physics, "Harvest"); | |
| 4900 | − PerformanceTimer perfTimer("handleOutgoingChanges"); | |
| 4896 | + PROFILE_RANGE(simulation_physics, "HandleChanges"); | |
| 4897 | + PerformanceTimer perfTimer("handleChanges"); | |
| 4901 | 4898 | |
| 4902 | 4899 | const VectorOfMotionStates& outgoingChanges = _physicsEngine->getChangedMotionStates(); |
| 4903 | 4900 | _entitySimulation->handleChangedMotionStates(outgoingChanges); |
| @@ -4908,17 +4905,15 @@ void Application::update(float deltaTime) { · 4 unmodified lines | ||
| 4908 | 4905 | }); |
| 4909 | 4906 | |
| 4910 | 4907 | if (!_aboutToQuit) { |
| 4911 | − // handleCollisionEvents() AFTER handleOutgoinChanges() | |
| 4908 | + // handleCollisionEvents() AFTER handleOutgoingChanges() | |
| 4912 | 4909 | { |
| 4913 | 4910 | PROFILE_RANGE(simulation_physics, "CollisionEvents"); |
| 4914 | − PerformanceTimer perfTimer("entities"); | |
| 4915 | 4911 | avatarManager->handleCollisionEvents(collisionEvents); |
| 4916 | 4912 | // Collision events (and their scripts) must not be handled when we're locked, above. (That would risk |
| 4917 | 4913 | // deadlock.) |
| 4918 | 4914 | _entitySimulation->handleCollisionEvents(collisionEvents); |
| 4919 | 4915 | } |
| 4920 | 4916 | |
| 4921 | − PROFILE_RANGE(simulation_physics, "UpdateEntities"); | |
| 4922 | 4917 | // NOTE: the getEntities()->update() call below will wait for lock |
| 4923 | 4918 | // and will simulate entity motion (the EntityTree has been given an EntitySimulation). |
| 4924 | 4919 | getEntities()->update(true); // update the models... |
| @@ -4929,7 +4924,8 @@ void Application::update(float deltaTime) { · 4 unmodified lines | ||
| 4929 | 4924 | myAvatar->harvestResultsFromPhysicsSimulation(deltaTime); |
| 4930 | 4925 | } |
| 4931 | 4926 | |
| 4932 | − if (Menu::getInstance()->isOptionChecked(MenuOption::DisplayDebugTimingDetails) && | |
| 4927 | + if (PerformanceTimer::isActive() && | |
| 4928 | + Menu::getInstance()->isOptionChecked(MenuOption::DisplayDebugTimingDetails) && | |
| 4933 | 4929 | Menu::getInstance()->isOptionChecked(MenuOption::ExpandPhysicsSimulationTiming)) { |
| 4934 | 4930 | _physicsEngine->harvestPerformanceStats(); |
| 4935 | 4931 | } |
| @@ -7506,4 +7502,9 @@ void Application::setAvatarOverrideUrl(const QUrl& url, bool save) { · 2570 unmodified lines | ||
| 7506 | 7502 | _avatarOverrideUrl = url; |
| 7507 | 7503 | _saveAvatarOverrideUrl = save; |
| 7508 | 7504 | } |
| 7505 | + | |
| 7506 | +void Application::saveNextPhysicsStats(QString filename) { | |
| 7507 | + _physicsEngine->saveNextPhysicsStats(filename); | |
| 7508 | +} | |
| 7509 | + | |
| 7509 | 7510 | #include "Application.moc" |