Improve Optick events

This commit is contained in:
Henrique Gemignani Passos Lima 2021-06-29 01:10:54 +03:00
parent d310dcfecb
commit 1b4e0dc754
4 changed files with 12 additions and 3 deletions

View File

@ -1,5 +1,7 @@
#include "Runtime/CDvdFile.hpp" #include "Runtime/CDvdFile.hpp"
#include <optick.h>
#include "Runtime/CDvdRequest.hpp" #include "Runtime/CDvdRequest.hpp"
#include "Runtime/CStopwatch.hpp" #include "Runtime/CStopwatch.hpp"
@ -67,6 +69,8 @@ std::vector<std::shared_ptr<IDvdRequest>> CDvdFile::m_RequestQueue;
void CDvdFile::WorkerProc() { void CDvdFile::WorkerProc() {
logvisor::RegisterThreadName("CDvdFile"); logvisor::RegisterThreadName("CDvdFile");
OPTICK_THREAD("CDvdFile");
while (m_WorkerRun.load()) { while (m_WorkerRun.load()) {
std::unique_lock lk{m_WorkerMutex}; std::unique_lock lk{m_WorkerMutex};
while (!m_RequestQueue.empty()) { while (!m_RequestQueue.empty()) {

View File

@ -337,8 +337,6 @@ public:
} }
void onAppIdle() noexcept { void onAppIdle() noexcept {
OPTICK_FRAME("MainThread");
if (!m_deferredProject.empty()) { if (!m_deferredProject.empty()) {
hecl::SystemString subPath; hecl::SystemString subPath;
hecl::ProjectRootPath projPath = hecl::SearchForProject(m_deferredProject, subPath); hecl::ProjectRootPath projPath = hecl::SearchForProject(m_deferredProject, subPath);
@ -363,7 +361,11 @@ public:
return; return;
} }
m_window->waitForRetrace(); {
OPTICK_EVENT("Wait for Retrace");
m_window->waitForRetrace();
}
OPTICK_FRAME("MainThread");
boo::SWindowRect rect = m_windowCallback.m_lastRect; boo::SWindowRect rect = m_windowCallback.m_lastRect;
rect.location = {0, 0}; rect.location = {0, 0};

View File

@ -1120,6 +1120,7 @@ void ImGuiConsole::ShowAppMainMenuBar(bool canInspect) {
s32 TranslateBooSpecialKey(boo::ESpecialKey key) { return 256 + static_cast<int>(key); } s32 TranslateBooSpecialKey(boo::ESpecialKey key) { return 256 + static_cast<int>(key); }
void ImGuiConsole::PreUpdate() { void ImGuiConsole::PreUpdate() {
OPTICK_EVENT();
if (!m_isInitialized) { if (!m_isInitialized) {
m_isInitialized = true; m_isInitialized = true;
m_cvarCommons.m_debugOverlayShowFrameCounter->addListener( m_cvarCommons.m_debugOverlayShowFrameCounter->addListener(
@ -1198,6 +1199,7 @@ void ImGuiConsole::PreUpdate() {
} }
void ImGuiConsole::PostUpdate() { void ImGuiConsole::PostUpdate() {
OPTICK_EVENT();
if (g_StateManager != nullptr && g_StateManager->GetObjectList()) { if (g_StateManager != nullptr && g_StateManager->GetObjectList()) {
// Clear deleted objects // Clear deleted objects
CObjectList& list = g_StateManager->GetAllObjectList(); CObjectList& list = g_StateManager->GetAllObjectList();

View File

@ -824,6 +824,7 @@ void CGameArea::StartStreamIn(CStateManager& mgr) {
if (xf0_24_postConstructed || xf0_27_loadPaused) if (xf0_24_postConstructed || xf0_27_loadPaused)
return; return;
OPTICK_EVENT();
VerifyTokenList(mgr); VerifyTokenList(mgr);
if (!xf0_26_tokensReady) { if (!xf0_26_tokensReady) {