From fa852c7dbe6c482c30215be366b99d6396c79544 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Mon, 1 Mar 2021 23:02:03 +0100 Subject: [PATCH] perf overlay: add missing graph vertex And fix potential division by 0 --- rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp b/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp index 0c0ba76d30..d0a0996989 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp @@ -762,7 +762,12 @@ namespace rsx auto& verts_graph = compiled_resources.draw_commands.back().verts; - const f32 x_stride = w * 1.f / m_datapoint_count; + f32 x_stride = w; + if (m_datapoint_count > 2) + { + x_stride /= (m_datapoint_count - 1); + } + const usz tail_index_offset = m_datapoints.size() - m_datapoint_count; for (u32 i = 0; i < m_datapoint_count; ++i)