perfoverlay: fix minimal graph min/max calculation

This commit is contained in:
Megamouse 2023-01-26 22:45:13 +01:00
parent f6759de1e9
commit e0baad417a

View File

@ -746,14 +746,11 @@ namespace rsx
return; return;
} }
m_min = max_v<f32>;
m_max = 0.0f; m_max = 0.0f;
m_avg = 0.0f; m_avg = 0.0f;
m_1p = 0.0f; m_1p = 0.0f;
if (m_show_min_max || m_show_1p_avg)
{
m_min = max_v<f32>;
std::vector<f32> valid_datapoints; std::vector<f32> valid_datapoints;
// Make sure min/max reflects the data being displayed, not the entire datapoints vector // Make sure min/max reflects the data being displayed, not the entire datapoints vector
@ -767,8 +764,11 @@ namespace rsx
m_max = std::max(m_max, dp); m_max = std::max(m_max, dp);
m_avg += dp; m_avg += dp;
if (m_show_1p_avg)
{
valid_datapoints.push_back(dp); valid_datapoints.push_back(dp);
} }
}
// Sanitize min value // Sanitize min value
m_min = std::min(m_min, m_max); m_min = std::min(m_min, m_max);
@ -789,11 +789,6 @@ namespace rsx
m_1p = std::accumulate(valid_datapoints.begin(), valid_datapoints.begin() + n_1p, 0.0f) / static_cast<float>(n_1p); m_1p = std::accumulate(valid_datapoints.begin(), valid_datapoints.begin() + n_1p, 0.0f) / static_cast<float>(n_1p);
} }
} }
else
{
m_min = 0.0f;
}
}
void graph::update() void graph::update()
{ {