Skip to content

Commit

Permalink
overlays: avoid division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Nov 15, 2019
1 parent fb96047 commit a17a5a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a17a5a7

Please sign in to comment.