diff --git a/Runtime/CDvdFile.cpp b/Runtime/CDvdFile.cpp index 94ec79905..34b9ca6fe 100644 --- a/Runtime/CDvdFile.cpp +++ b/Runtime/CDvdFile.cpp @@ -1,5 +1,7 @@ #include "Runtime/CDvdFile.hpp" +#include + #include "Runtime/CDvdRequest.hpp" #include "Runtime/CStopwatch.hpp" @@ -67,6 +69,8 @@ std::vector> CDvdFile::m_RequestQueue; void CDvdFile::WorkerProc() { logvisor::RegisterThreadName("CDvdFile"); + OPTICK_THREAD("CDvdFile"); + while (m_WorkerRun.load()) { std::unique_lock lk{m_WorkerMutex}; while (!m_RequestQueue.empty()) { diff --git a/Runtime/CMain.cpp b/Runtime/CMain.cpp index 0a7df2534..156fb65b4 100644 --- a/Runtime/CMain.cpp +++ b/Runtime/CMain.cpp @@ -337,8 +337,6 @@ public: } void onAppIdle() noexcept { - OPTICK_FRAME("MainThread"); - if (!m_deferredProject.empty()) { hecl::SystemString subPath; hecl::ProjectRootPath projPath = hecl::SearchForProject(m_deferredProject, subPath); @@ -363,7 +361,11 @@ public: return; } - m_window->waitForRetrace(); + { + OPTICK_EVENT("Wait for Retrace"); + m_window->waitForRetrace(); + } + OPTICK_FRAME("MainThread"); boo::SWindowRect rect = m_windowCallback.m_lastRect; rect.location = {0, 0}; diff --git a/Runtime/ImGuiConsole.cpp b/Runtime/ImGuiConsole.cpp index d3a455349..2726ec165 100644 --- a/Runtime/ImGuiConsole.cpp +++ b/Runtime/ImGuiConsole.cpp @@ -1120,6 +1120,7 @@ void ImGuiConsole::ShowAppMainMenuBar(bool canInspect) { s32 TranslateBooSpecialKey(boo::ESpecialKey key) { return 256 + static_cast(key); } void ImGuiConsole::PreUpdate() { + OPTICK_EVENT(); if (!m_isInitialized) { m_isInitialized = true; m_cvarCommons.m_debugOverlayShowFrameCounter->addListener( @@ -1198,6 +1199,7 @@ void ImGuiConsole::PreUpdate() { } void ImGuiConsole::PostUpdate() { + OPTICK_EVENT(); if (g_StateManager != nullptr && g_StateManager->GetObjectList()) { // Clear deleted objects CObjectList& list = g_StateManager->GetAllObjectList(); diff --git a/Runtime/World/CGameArea.cpp b/Runtime/World/CGameArea.cpp index a4626307b..cbb18985a 100644 --- a/Runtime/World/CGameArea.cpp +++ b/Runtime/World/CGameArea.cpp @@ -824,6 +824,7 @@ void CGameArea::StartStreamIn(CStateManager& mgr) { if (xf0_24_postConstructed || xf0_27_loadPaused) return; + OPTICK_EVENT(); VerifyTokenList(mgr); if (!xf0_26_tokensReady) {