overlays: avoid division by zero

This commit is contained in:
Megamouse 2019-11-14 20:10:58 +01:00
parent fb96047d2f
commit a17a5a76a0

View File

@ -383,7 +383,7 @@ namespace rsx
rsx_cycles += rsx_thread->get_cycles();
total_cycles = ppu_cycles + spu_cycles + rsx_cycles;
total_cycles = std::max<u64>(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);