mirror of
https://github.com/open-goal/jak-project.git
synced 2024-11-27 00:10:31 +00:00
game: some UX cleanup
This commit is contained in:
parent
feafb27b0d
commit
9b2f3e206d
@ -39,7 +39,8 @@ GlobalProfiler::GlobalProfiler() {
|
||||
m_nodes.resize(m_max_events);
|
||||
}
|
||||
|
||||
void GlobalProfiler::update_event_buffer_size() {
|
||||
void GlobalProfiler::update_event_buffer_size(size_t new_size) {
|
||||
m_max_events = new_size;
|
||||
m_nodes.resize(m_max_events);
|
||||
}
|
||||
|
||||
@ -73,6 +74,10 @@ void GlobalProfiler::root_event() {
|
||||
instant_event("ROOT");
|
||||
}
|
||||
|
||||
size_t GlobalProfiler::get_next_idx() {
|
||||
return (m_next_idx % m_nodes.size());
|
||||
}
|
||||
|
||||
void GlobalProfiler::begin_event(const char* name) {
|
||||
event(name, ProfNode::BEGIN);
|
||||
}
|
||||
|
@ -17,7 +17,8 @@ struct ProfNode {
|
||||
class GlobalProfiler {
|
||||
public:
|
||||
GlobalProfiler();
|
||||
void update_event_buffer_size();
|
||||
size_t get_max_events() { return m_max_events; }
|
||||
void update_event_buffer_size(size_t new_size);
|
||||
void set_waiting_for_event(const std::string& event_name);
|
||||
void instant_event(const char* name);
|
||||
void begin_event(const char* name);
|
||||
@ -28,12 +29,13 @@ class GlobalProfiler {
|
||||
void dump_to_json();
|
||||
void root_event();
|
||||
bool is_enabled() { return m_enabled; }
|
||||
size_t get_next_idx();
|
||||
|
||||
int m_max_events = 65536;
|
||||
bool m_enable_compression = false;
|
||||
|
||||
private:
|
||||
std::atomic_bool m_enabled = false;
|
||||
size_t m_max_events = 65536;
|
||||
u64 m_t0 = 0;
|
||||
std::atomic_size_t m_next_idx = 0;
|
||||
std::vector<ProfNode> m_nodes;
|
||||
|
@ -165,9 +165,14 @@ void OpenGlDebugGui::draw(const DmaStats& dma_stats) {
|
||||
if (ImGui::Checkbox("Record Events", &record_events)) {
|
||||
prof().set_enable(record_events);
|
||||
}
|
||||
ImGui::InputInt("Event Buffer Size", &prof().m_max_events);
|
||||
ImGui::SameLine();
|
||||
ImGui::Text(fmt::format("({}/{})", prof().get_next_idx(), prof().get_max_events()).c_str());
|
||||
ImGui::InputInt("Event Buffer Size", &max_event_buffer_size);
|
||||
if (ImGui::Button("Resize")) {
|
||||
prof().update_event_buffer_size();
|
||||
prof().update_event_buffer_size(max_event_buffer_size);
|
||||
}
|
||||
if (ImGui::Button("Reset Events")) {
|
||||
prof().clear();
|
||||
}
|
||||
ImGui::Separator();
|
||||
ImGui::Checkbox("Enable Compression", &prof().m_enable_compression);
|
||||
|
@ -64,6 +64,7 @@ class OpenGlDebugGui {
|
||||
|
||||
bool small_profiler = false;
|
||||
bool record_events = false;
|
||||
int max_event_buffer_size = 65536;
|
||||
bool want_reboot_in_debug = false;
|
||||
|
||||
bool screenshot_hotkey_enabled = true;
|
||||
|
Loading…
Reference in New Issue
Block a user