mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-09-17 15:02:33 +00:00
overlays: perf_metrics_overlay to seperate header
this is done to prevent severe conflicts with upcoming changes
This commit is contained in:
parent
b84fd29abc
commit
d6b0361a02
6 changed files with 75 additions and 63 deletions
|
@ -1,5 +1,5 @@
|
|||
#include "stdafx.h"
|
||||
#include "overlays.h"
|
||||
#include "overlay_perf_metrics.h"
|
||||
#include "../GSRender.h"
|
||||
|
||||
#include "Emu/Cell/SPUThread.h"
|
||||
|
|
69
rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.h
Normal file
69
rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.h
Normal file
|
@ -0,0 +1,69 @@
|
|||
#pragma once
|
||||
|
||||
#include "overlays.h"
|
||||
|
||||
namespace rsx
|
||||
{
|
||||
namespace overlays
|
||||
{
|
||||
struct perf_metrics_overlay : overlay
|
||||
{
|
||||
private:
|
||||
// minimal - fps
|
||||
// low - fps, total cpu usage
|
||||
// medium - fps, detailed cpu usage
|
||||
// high - fps, frametime, detailed cpu usage, thread number, rsx load
|
||||
detail_level m_detail{};
|
||||
|
||||
screen_quadrant m_quadrant{};
|
||||
positioni m_position{};
|
||||
|
||||
label m_body{};
|
||||
label m_titles{};
|
||||
|
||||
bool m_graphs_enabled{};
|
||||
graph m_fps_graph;
|
||||
graph m_frametime_graph;
|
||||
|
||||
CPUStats m_cpu_stats{};
|
||||
Timer m_update_timer{};
|
||||
Timer m_frametime_timer{};
|
||||
u32 m_update_interval{}; // in ms
|
||||
u32 m_frames{};
|
||||
std::string m_font{};
|
||||
u32 m_font_size{};
|
||||
u32 m_margin_x{}; // horizontal distance to the screen border relative to the screen_quadrant in px
|
||||
u32 m_margin_y{}; // vertical distance to the screen border relative to the screen_quadrant in px
|
||||
f32 m_opacity{}; // 0..1
|
||||
|
||||
bool m_force_update{};
|
||||
bool m_is_initialised{};
|
||||
|
||||
const std::string title1_medium{ "CPU Utilization:" };
|
||||
const std::string title1_high{ "Host Utilization (CPU):" };
|
||||
const std::string title2{ "Guest Utilization (PS3):" };
|
||||
|
||||
void reset_transform(label& elm, u16 bottom_margin = 0) const;
|
||||
void reset_transforms();
|
||||
void reset_body();
|
||||
void reset_titles();
|
||||
void reset_text();
|
||||
|
||||
public:
|
||||
void init();
|
||||
|
||||
void set_detail_level(detail_level level);
|
||||
void set_position(screen_quadrant quadrant);
|
||||
void set_update_interval(u32 update_interval);
|
||||
void set_font(std::string font);
|
||||
void set_font_size(u32 font_size);
|
||||
void set_margins(u32 margin_x, u32 margin_y);
|
||||
void set_opacity(f32 opacity);
|
||||
void force_next_update();
|
||||
|
||||
void update() override;
|
||||
|
||||
compiled_resource get_compiled() override;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -325,68 +325,6 @@ namespace rsx
|
|||
}
|
||||
};
|
||||
|
||||
struct perf_metrics_overlay : overlay
|
||||
{
|
||||
private:
|
||||
/*
|
||||
minimal - fps
|
||||
low - fps, total cpu usage
|
||||
medium - fps, detailed cpu usage
|
||||
high - fps, frametime, detailed cpu usage, thread number, rsx load
|
||||
*/
|
||||
detail_level m_detail{};
|
||||
|
||||
screen_quadrant m_quadrant{};
|
||||
positioni m_position{};
|
||||
|
||||
label m_body{};
|
||||
label m_titles{};
|
||||
|
||||
bool m_graphs_enabled{};
|
||||
graph m_fps_graph;
|
||||
graph m_frametime_graph;
|
||||
|
||||
CPUStats m_cpu_stats{};
|
||||
Timer m_update_timer{};
|
||||
Timer m_frametime_timer{};
|
||||
u32 m_update_interval{}; // in ms
|
||||
u32 m_frames{};
|
||||
std::string m_font{};
|
||||
u32 m_font_size{};
|
||||
u32 m_margin_x{}; // horizontal distance to the screen border relative to the screen_quadrant in px
|
||||
u32 m_margin_y{}; // vertical distance to the screen border relative to the screen_quadrant in px
|
||||
f32 m_opacity{}; // 0..1
|
||||
|
||||
bool m_force_update{};
|
||||
bool m_is_initialised{};
|
||||
|
||||
const std::string title1_medium{"CPU Utilization:"};
|
||||
const std::string title1_high{"Host Utilization (CPU):"};
|
||||
const std::string title2{"Guest Utilization (PS3):"};
|
||||
|
||||
void reset_transform(label& elm, u16 bottom_margin = 0) const;
|
||||
void reset_transforms();
|
||||
void reset_body();
|
||||
void reset_titles();
|
||||
void reset_text();
|
||||
|
||||
public:
|
||||
void init();
|
||||
|
||||
void set_detail_level(detail_level level);
|
||||
void set_position(screen_quadrant quadrant);
|
||||
void set_update_interval(u32 update_interval);
|
||||
void set_font(std::string font);
|
||||
void set_font_size(u32 font_size);
|
||||
void set_margins(u32 margin_x, u32 margin_y);
|
||||
void set_opacity(f32 opacity);
|
||||
void force_next_update();
|
||||
|
||||
void update() override;
|
||||
|
||||
compiled_resource get_compiled() override;
|
||||
};
|
||||
|
||||
struct osk_dialog : public user_interface, public OskDialogBase
|
||||
{
|
||||
using callback_t = std::function<void(const std::string&)>;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "rsx_utils.h"
|
||||
#include "Emu/Cell/lv2/sys_event.h"
|
||||
#include "Emu/Cell/Modules/cellGcmSys.h"
|
||||
#include "Overlays/overlay_perf_metrics.h"
|
||||
|
||||
#include "Utilities/span.h"
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
|
|
@ -392,6 +392,7 @@
|
|||
<ClInclude Include="Emu\Cell\Modules\cellSsl.h" />
|
||||
<ClInclude Include="Emu\Io\Keyboard.h" />
|
||||
<ClInclude Include="Emu\RSX\Common\texture_cache_helpers.h" />
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_perf_metrics.h" />
|
||||
<ClInclude Include="util\atomic.hpp" />
|
||||
<ClInclude Include="..\Utilities\BEType.h" />
|
||||
<ClInclude Include="..\Utilities\bin_patch.h" />
|
||||
|
|
|
@ -1576,5 +1576,8 @@
|
|||
<ClInclude Include="Emu\Cell\Modules\cellSsl.h">
|
||||
<Filter>Emu\Cell\Modules</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\RSX\Overlays\overlay_perf_metrics.h">
|
||||
<Filter>Emu\GPU\RSX\Overlays</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue