From 75f63b6a4b9ebb43678cb2d8b8802dfd1b218efc Mon Sep 17 00:00:00 2001 From: Causeless Date: Tue, 28 Nov 2023 20:23:14 +0000 Subject: [PATCH] Added a bunch more profiling zones --- Entities/SceneLayer.cpp | 3 +++ System/PathFinder.cpp | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/Entities/SceneLayer.cpp b/Entities/SceneLayer.cpp index 25b985f5d..b86189f10 100644 --- a/Entities/SceneLayer.cpp +++ b/Entities/SceneLayer.cpp @@ -6,6 +6,8 @@ #include "ActivityMan.h" #include "ThreadMan.h" +#include "tracy/Tracy.hpp" + namespace RTE { ConcreteClassInfo(SceneLayerTracked, Entity, 0); @@ -302,6 +304,7 @@ namespace RTE { // Start a new thread to clear the backbuffer bitmap asynchronously. m_BitmapClearTask = g_ThreadMan.GetPriorityThreadPool().submit([this, clearTo](BITMAP *bitmap, std::vector drawings) { + ZoneScopedN("Clear Tracked Backbuffer"); ClearDrawings(bitmap, drawings, clearTo); }, m_BackBitmap, m_Drawings); diff --git a/System/PathFinder.cpp b/System/PathFinder.cpp index f21ed39ae..6711f7d23 100644 --- a/System/PathFinder.cpp +++ b/System/PathFinder.cpp @@ -5,6 +5,8 @@ #include "SceneMan.h" #include "ThreadMan.h" +#include "tracy/tracy.hpp" + namespace RTE { // One pathfinder per thread, lazily initialized. Shouldn't access this directly, use GetPather() instead. @@ -136,6 +138,8 @@ namespace RTE { ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// int PathFinder::CalculatePath(Vector start, Vector end, std::list &pathResult, float &totalCostResult, float digStrength) { + ZoneScoped; + ++m_CurrentPathingRequests; // Make sure start and end are within scene bounds. @@ -250,6 +254,8 @@ namespace RTE { ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// std::vector PathFinder::RecalculateAreaCosts(std::deque &boxList, int nodeUpdateLimit) { + ZoneScoped; + std::unordered_set nodeIDsToUpdate; while (!boxList.empty()) { @@ -463,6 +469,8 @@ namespace RTE { ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// bool PathFinder::UpdateNodeList(const std::vector &nodeVec) { + ZoneScoped; + std::atomic anyChange = false; // Update all the costs going out from each node.