Remove remnants of frame profiler code

This commit is contained in:
Exzap 2023-06-24 08:04:40 +02:00
parent 4a04fab9c4
commit 45072fccb2
8 changed files with 9 additions and 81 deletions

View file

@ -604,42 +604,3 @@ void LatteOverlay_updateStats(double fps, sint32 drawcalls)
// update vram
g_renderer->GetVRAMInfo(g_state.vramUsage, g_state.vramTotal);
}
void LatteOverlay_updateStatsPerFrame()
{
if (!ActiveSettings::FrameProfilerEnabled())
return;
// update frametime graph
uint32 frameTime_total = (uint32)PPCTimer_tscToMicroseconds(performanceMonitor.gpuTime_frameTime.getPreviousFrameValue());
uint32 frameTime_idle = (uint32)PPCTimer_tscToMicroseconds(performanceMonitor.gpuTime_idleTime.getPreviousFrameValue());
uint32 frameTime_dcStageTextures = (uint32)PPCTimer_tscToMicroseconds(performanceMonitor.gpuTime_dcStageTextures.getPreviousFrameValue());
uint32 frameTime_dcStageVertexMgr = (uint32)PPCTimer_tscToMicroseconds(performanceMonitor.gpuTime_dcStageVertexMgr.getPreviousFrameValue());
uint32 frameTime_dcStageShaderAndUniformMgr = (uint32)PPCTimer_tscToMicroseconds(performanceMonitor.gpuTime_dcStageShaderAndUniformMgr.getPreviousFrameValue());
uint32 frameTime_dcStageIndexMgr = (uint32)PPCTimer_tscToMicroseconds(performanceMonitor.gpuTime_dcStageIndexMgr.getPreviousFrameValue());
uint32 frameTime_dcStageMRT = (uint32)PPCTimer_tscToMicroseconds(performanceMonitor.gpuTime_dcStageMRT.getPreviousFrameValue());
uint32 frameTime_dcStageDrawcallAPI = (uint32)PPCTimer_tscToMicroseconds(performanceMonitor.gpuTime_dcStageDrawcallAPI.getPreviousFrameValue());
uint32 frameTime_waitForAsync = (uint32)PPCTimer_tscToMicroseconds(performanceMonitor.gpuTime_waitForAsync.getPreviousFrameValue());
// make sure total frame time is not less than it's sums
uint32 minimumExpectedFrametime =
frameTime_idle +
frameTime_dcStageTextures +
frameTime_dcStageVertexMgr +
frameTime_dcStageShaderAndUniformMgr +
frameTime_dcStageIndexMgr +
frameTime_dcStageMRT +
frameTime_dcStageDrawcallAPI +
frameTime_waitForAsync;
frameTime_total = std::max(frameTime_total, minimumExpectedFrametime);
//g_state.frametimeGraph.appendEntry();
//g_state.frametimeGraph.setCurrentEntryValue(0xFF404040, frameTime_idle);
//g_state.frametimeGraph.setCurrentEntryValue(0xFFFFC0FF, frameTime_waitForAsync);
//g_state.frametimeGraph.setCurrentEntryValue(0xFF000040, frameTime_dcStageTextures); // dark red
//g_state.frametimeGraph.setCurrentEntryValue(0xFF004000, frameTime_dcStageVertexMgr); // dark green
//g_state.frametimeGraph.setCurrentEntryValue(0xFFFFFF80, frameTime_dcStageShaderAndUniformMgr); // blueish
//g_state.frametimeGraph.setCurrentEntryValue(0xFF800080, frameTime_dcStageIndexMgr); // purple
//g_state.frametimeGraph.setCurrentEntryValue(0xFF00FF00, frameTime_dcStageMRT); // green
//g_state.frametimeGraph.setCurrentEntryValue(0xFF00FFFF, frameTime_dcStageDrawcallAPI); // yellow
//g_state.frametimeGraph.setCurrentEntryValue(0xFFBBBBBB, frameTime_total - minimumExpectedFrametime);
}

View file

@ -3,6 +3,5 @@
void LatteOverlay_init();
void LatteOverlay_render(bool pad_view);
void LatteOverlay_updateStats(double fps, sint32 drawcalls);
void LatteOverlay_updateStatsPerFrame();
void LatteOverlay_pushNotification(const std::string& text, sint32 duration);

View file

@ -113,7 +113,6 @@ void LattePerformanceMonitor_frameEnd()
gui_updateWindowTitles(false, false, fps);
}
}
LatteOverlay_updateStatsPerFrame();
}
void LattePerformanceMonitor_frameBegin()

View file

@ -1201,21 +1201,11 @@ void OpenGLRenderer::draw_beginSequence()
void OpenGLRenderer::draw_execute(uint32 baseVertex, uint32 baseInstance, uint32 instanceCount, uint32 count, MPTR indexDataMPTR, Latte::LATTE_VGT_DMA_INDEX_TYPE::E_INDEX_TYPE indexType, bool isFirst)
{
bool isMinimal = !isFirst;
if (ActiveSettings::FrameProfilerEnabled())
{
if (isMinimal)
draw_genericDrawHandler<true, true>(baseVertex, baseInstance, instanceCount, count, indexDataMPTR, indexType);
else
draw_genericDrawHandler<false, true>(baseVertex, baseInstance, instanceCount, count, indexDataMPTR, indexType);
}
else
{
if (isMinimal)
draw_genericDrawHandler<true, false>(baseVertex, baseInstance, instanceCount, count, indexDataMPTR, indexType);
else
draw_genericDrawHandler<false, false>(baseVertex, baseInstance, instanceCount, count, indexDataMPTR, indexType);
}
}
void OpenGLRenderer::draw_endSequence()
{

View file

@ -115,9 +115,9 @@ void DebugLogStackTrace(OSThread_t* thread, MPTR sp)
void coreinitExport_OSPanic(PPCInterpreter_t* hCPU)
{
debug_printf("OSPanic!\n");
debug_printf("File: %s:%d\n", memory_getPointerFromVirtualOffset(hCPU->gpr[3]), hCPU->gpr[4]);
debug_printf("Msg: %s\n", memory_getPointerFromVirtualOffset(hCPU->gpr[5]));
cemuLog_log(LogType::Force, "OSPanic!\n");
cemuLog_log(LogType::Force, "File: {}:{}\n", (const char*)memory_getPointerFromVirtualOffset(hCPU->gpr[3]), hCPU->gpr[4]);
cemuLog_log(LogType::Force, "Msg: {}\n", (const char*)memory_getPointerFromVirtualOffset(hCPU->gpr[5]));
DebugLogStackTrace(coreinit::OSGetCurrentThread(), coreinit::OSGetStackPointer());
#ifdef CEMU_DEBUG_ASSERT
assert_dbg();
@ -271,7 +271,8 @@ namespace coreinit
void coreinit_exit(uint32 r)
{
cemuLog_log(LogType::Force, "coreinit.exit({})", r);
cemuLog_log(LogType::Force, "The title terminated the process by calling coreinit.exit({})", (sint32)r);
DebugLogStackTrace(coreinit::OSGetCurrentThread(), coreinit::OSGetStackPointer());
cemu_assert_debug(false);
// never return
while (true) std::this_thread::sleep_for(std::chrono::milliseconds(100));

View file

@ -174,16 +174,6 @@ void ActiveSettings::EnableDumpLibcurlRequests(bool state)
s_dump_libcurl_requests = state;
}
bool ActiveSettings::FrameProfilerEnabled()
{
return s_frame_profiler_enabled;
}
void ActiveSettings::EnableFrameProfiler(bool state)
{
s_frame_profiler_enabled = state;
}
bool ActiveSettings::VPADDelayEnabled()
{
const uint64 titleId = CafeSystem::GetForegroundTitleId();

View file

@ -104,10 +104,6 @@ public:
static void EnableDumpTextures(bool state);
static void EnableDumpLibcurlRequests(bool state);
// debug
[[nodiscard]] static bool FrameProfilerEnabled();
static void EnableFrameProfiler(bool state);
// hacks
[[nodiscard]] static bool VPADDelayEnabled();
[[nodiscard]] static bool ShaderPreventInfiniteLoopsEnabled();
@ -124,7 +120,6 @@ private:
inline static uint8 s_timer_shift = 3; // right shift factor, 0 -> 8x, 3 -> 1x, 4 -> 0.5x
// debug
inline static bool s_frame_profiler_enabled = false;
inline static bool s_audio_aux_only = false;
inline static bool s_has_required_online_files = false;

View file

@ -139,7 +139,6 @@ enum
MAINFRAME_MENU_ID_DEBUG_VIEW_PPC_DEBUGGER,
MAINFRAME_MENU_ID_DEBUG_VIEW_AUDIO_DEBUGGER,
MAINFRAME_MENU_ID_DEBUG_VIEW_TEXTURE_RELATIONS,
MAINFRAME_MENU_ID_DEBUG_SHOW_FRAME_PROFILER,
MAINFRAME_MENU_ID_DEBUG_AUDIO_AUX_ONLY,
MAINFRAME_MENU_ID_DEBUG_VK_ACCURATE_BARRIERS,
@ -225,7 +224,6 @@ EVT_MENU(MAINFRAME_MENU_ID_DEBUG_VIEW_PPC_THREADS, MainWindow::OnDebugViewPPCThr
EVT_MENU(MAINFRAME_MENU_ID_DEBUG_VIEW_PPC_DEBUGGER, MainWindow::OnDebugViewPPCDebugger)
EVT_MENU(MAINFRAME_MENU_ID_DEBUG_VIEW_AUDIO_DEBUGGER, MainWindow::OnDebugViewAudioDebugger)
EVT_MENU(MAINFRAME_MENU_ID_DEBUG_VIEW_TEXTURE_RELATIONS, MainWindow::OnDebugViewTextureRelations)
EVT_MENU(MAINFRAME_MENU_ID_DEBUG_SHOW_FRAME_PROFILER, MainWindow::OnDebugSetting)
// help menu
EVT_MENU(MAINFRAME_MENU_ID_HELP_WEB, MainWindow::OnHelpVistWebpage)
EVT_MENU(MAINFRAME_MENU_ID_HELP_ABOUT, MainWindow::OnHelpAbout)
@ -1038,10 +1036,6 @@ void MainWindow::OnDebugSetting(wxCommandEvent& event)
wxMessageBox(_("Dump complete"));
}*/
}
else if (event.GetId() == MAINFRAME_MENU_ID_DEBUG_SHOW_FRAME_PROFILER)
{
ActiveSettings::EnableFrameProfiler(event.IsChecked());
}
else if (event.GetId() == MAINFRAME_MENU_ID_DEBUG_DUMP_CURL_REQUESTS)
{
// toggle debug -> dump -> curl requests
@ -2231,7 +2225,6 @@ void MainWindow::RecreateMenu()
debugMenu->Append(MAINFRAME_MENU_ID_DEBUG_VIEW_PPC_DEBUGGER, _("&View PPC debugger"));
debugMenu->Append(MAINFRAME_MENU_ID_DEBUG_VIEW_AUDIO_DEBUGGER, _("&View audio debugger"));
debugMenu->Append(MAINFRAME_MENU_ID_DEBUG_VIEW_TEXTURE_RELATIONS, _("&View texture cache info"));
debugMenu->AppendCheckItem(MAINFRAME_MENU_ID_DEBUG_SHOW_FRAME_PROFILER, _("&Show frame profiler"), wxEmptyString);
debugMenu->Append(MAINFRAME_MENU_ID_DEBUG_DUMP_RAM, _("&Dump current RAM"));
// debugMenu->Append(MAINFRAME_MENU_ID_DEBUG_DUMP_FST, _("&Dump WUD filesystem"))->Enable(false);