perf overlays: add detail level none (hides FPS)

This commit is contained in:
Megamouse 2021-03-01 20:37:32 +01:00
parent c71bc25090
commit 038c708a0a
5 changed files with 31 additions and 3 deletions

View file

@ -183,7 +183,12 @@ namespace rsx
// Position the graphs within the body
const u16 graphs_width = m_body.w;
const u16 body_left = m_body.x;
u16 y_offset = m_body.y + m_body.h + perf_overlay_padding;
u16 y_offset = m_body.y;
if (m_body.h > 0)
{
y_offset += m_body.h + perf_overlay_padding;
}
if (m_framerate_graph_enabled)
{
@ -220,7 +225,8 @@ namespace rsx
switch (m_detail)
{
case detail_level::minimal:
case detail_level::none: [[fallthrough]];
case detail_level::minimal: [[fallthrough]];
case detail_level::low: m_titles.set_text(""); break;
case detail_level::medium: m_titles.set_text(fmt::format("\n\n%s", title1_medium)); break;
case detail_level::high: m_titles.set_text(fmt::format("\n\n%s\n\n\n\n\n\n%s", title1_high, title2)); break;
@ -459,10 +465,15 @@ namespace rsx
[[fallthrough]];
}
case detail_level::minimal:
{
[[fallthrough]];
}
case detail_level::none:
{
m_fps = std::max(0.f, static_cast<f32>(m_frames / (elapsed_update / 1000)));
if (m_is_initialised && m_framerate_graph_enabled)
m_fps_graph.record_datapoint(m_fps);
break;
}
}
}
@ -472,6 +483,10 @@ namespace rsx
switch (m_detail)
{
case detail_level::none:
{
break;
}
case detail_level::minimal:
{
perf_text += fmt::format("FPS : %05.2f", m_fps);
@ -512,7 +527,15 @@ namespace rsx
m_body.set_text(perf_text);
if (m_body.auto_resize())
if (perf_text.empty())
{
if (m_body.w > 0 || m_body.h > 0)
{
m_body.set_size(0, 0);
reset_transforms();
}
}
else if (m_body.auto_resize())
{
reset_transforms();
}

View file

@ -11,6 +11,8 @@ namespace rsx
struct perf_metrics_overlay : overlay
{
private:
// The detail level does not affect frame graphs apart from their width.
// none
// minimal - fps
// low - fps, total cpu usage
// medium - fps, detailed cpu usage

View file

@ -132,6 +132,7 @@ void fmt_class_string<detail_level>::format(std::string& out, u64 arg)
{
switch (value)
{
case detail_level::none: return "None";
case detail_level::minimal: return "Minimal";
case detail_level::low: return "Low";
case detail_level::medium: return "Medium";

View file

@ -147,6 +147,7 @@ enum class msaa_level
enum class detail_level
{
none,
minimal,
low,
medium,

View file

@ -887,6 +887,7 @@ QString emu_settings::GetLocalizedSetting(const QString& original, emu_settings_
case emu_settings_type::PerfOverlayDetailLevel:
switch (static_cast<detail_level>(index))
{
case detail_level::none: return tr("None", "Detail Level");
case detail_level::minimal: return tr("Minimal", "Detail Level");
case detail_level::low: return tr("Low", "Detail Level");
case detail_level::medium: return tr("Medium", "Detail Level");