From a17a5a76a0eca08628a338efdeb063942fa290d7 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Thu, 14 Nov 2019 20:10:58 +0100 Subject: [PATCH] overlays: avoid division by zero --- rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp b/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp index d9aacf9730..c1b8439788 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp @@ -383,7 +383,7 @@ namespace rsx rsx_cycles += rsx_thread->get_cycles(); - total_cycles = ppu_cycles + spu_cycles + rsx_cycles; + total_cycles = std::max(1, ppu_cycles + spu_cycles + rsx_cycles); cpu_usage = m_cpu_stats.get_usage(); ppu_usage = std::clamp(cpu_usage * ppu_cycles / total_cycles, 0.f, 100.f);