diff options
Diffstat (limited to '')
| -rw-r--r-- | src/citra_qt/bootmanager.cpp | 2 | ||||
| -rw-r--r-- | src/citra_qt/debugger/profiler.cpp | 13 | ||||
| -rw-r--r-- | src/citra_qt/debugger/profiler.h | 3 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 9 | ||||
| -rw-r--r-- | src/common/microprofile.h | 4 |
5 files changed, 30 insertions, 1 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 8e60b9cad..01b81c11c 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp | |||
| @@ -71,7 +71,9 @@ void EmuThread::run() { | |||
| 71 | // Shutdown the core emulation | 71 | // Shutdown the core emulation |
| 72 | System::Shutdown(); | 72 | System::Shutdown(); |
| 73 | 73 | ||
| 74 | #if MICROPROFILE_ENABLED | ||
| 74 | MicroProfileOnThreadExit(); | 75 | MicroProfileOnThreadExit(); |
| 76 | #endif | ||
| 75 | 77 | ||
| 76 | render_window->moveContext(); | 78 | render_window->moveContext(); |
| 77 | } | 79 | } |
diff --git a/src/citra_qt/debugger/profiler.cpp b/src/citra_qt/debugger/profiler.cpp index 4f6ba0e1f..e90973b8e 100644 --- a/src/citra_qt/debugger/profiler.cpp +++ b/src/citra_qt/debugger/profiler.cpp | |||
| @@ -14,8 +14,10 @@ | |||
| 14 | 14 | ||
| 15 | // Include the implementation of the UI in this file. This isn't in microprofile.cpp because the | 15 | // Include the implementation of the UI in this file. This isn't in microprofile.cpp because the |
| 16 | // non-Qt frontends don't need it (and don't implement the UI drawing hooks either). | 16 | // non-Qt frontends don't need it (and don't implement the UI drawing hooks either). |
| 17 | #if MICROPROFILE_ENABLED | ||
| 17 | #define MICROPROFILEUI_IMPL 1 | 18 | #define MICROPROFILEUI_IMPL 1 |
| 18 | #include "common/microprofileui.h" | 19 | #include "common/microprofileui.h" |
| 20 | #endif | ||
| 19 | 21 | ||
| 20 | using namespace Common::Profiling; | 22 | using namespace Common::Profiling; |
| 21 | 23 | ||
| @@ -148,6 +150,8 @@ void ProfilerWidget::setProfilingInfoUpdateEnabled(bool enable) | |||
| 148 | } | 150 | } |
| 149 | } | 151 | } |
| 150 | 152 | ||
| 153 | #if MICROPROFILE_ENABLED | ||
| 154 | |||
| 151 | class MicroProfileWidget : public QWidget { | 155 | class MicroProfileWidget : public QWidget { |
| 152 | public: | 156 | public: |
| 153 | MicroProfileWidget(QWidget* parent = nullptr); | 157 | MicroProfileWidget(QWidget* parent = nullptr); |
| @@ -171,6 +175,8 @@ private: | |||
| 171 | QTimer update_timer; | 175 | QTimer update_timer; |
| 172 | }; | 176 | }; |
| 173 | 177 | ||
| 178 | #endif | ||
| 179 | |||
| 174 | MicroProfileDialog::MicroProfileDialog(QWidget* parent) | 180 | MicroProfileDialog::MicroProfileDialog(QWidget* parent) |
| 175 | : QWidget(parent, Qt::Dialog) | 181 | : QWidget(parent, Qt::Dialog) |
| 176 | { | 182 | { |
| @@ -180,6 +186,8 @@ MicroProfileDialog::MicroProfileDialog(QWidget* parent) | |||
| 180 | // Remove the "?" button from the titlebar and enable the maximize button | 186 | // Remove the "?" button from the titlebar and enable the maximize button |
| 181 | setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint | Qt::WindowMaximizeButtonHint); | 187 | setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint | Qt::WindowMaximizeButtonHint); |
| 182 | 188 | ||
| 189 | #if MICROPROFILE_ENABLED | ||
| 190 | |||
| 183 | MicroProfileWidget* widget = new MicroProfileWidget(this); | 191 | MicroProfileWidget* widget = new MicroProfileWidget(this); |
| 184 | 192 | ||
| 185 | QLayout* layout = new QVBoxLayout(this); | 193 | QLayout* layout = new QVBoxLayout(this); |
| @@ -191,6 +199,7 @@ MicroProfileDialog::MicroProfileDialog(QWidget* parent) | |||
| 191 | setFocusProxy(widget); | 199 | setFocusProxy(widget); |
| 192 | widget->setFocusPolicy(Qt::StrongFocus); | 200 | widget->setFocusPolicy(Qt::StrongFocus); |
| 193 | widget->setFocus(); | 201 | widget->setFocus(); |
| 202 | #endif | ||
| 194 | } | 203 | } |
| 195 | 204 | ||
| 196 | QAction* MicroProfileDialog::toggleViewAction() { | 205 | QAction* MicroProfileDialog::toggleViewAction() { |
| @@ -218,6 +227,9 @@ void MicroProfileDialog::hideEvent(QHideEvent* ev) { | |||
| 218 | QWidget::hideEvent(ev); | 227 | QWidget::hideEvent(ev); |
| 219 | } | 228 | } |
| 220 | 229 | ||
| 230 | |||
| 231 | #if MICROPROFILE_ENABLED | ||
| 232 | |||
| 221 | /// There's no way to pass a user pointer to MicroProfile, so this variable is used to make the | 233 | /// There's no way to pass a user pointer to MicroProfile, so this variable is used to make the |
| 222 | /// QPainter available inside the drawing callbacks. | 234 | /// QPainter available inside the drawing callbacks. |
| 223 | static QPainter* mp_painter = nullptr; | 235 | static QPainter* mp_painter = nullptr; |
| @@ -337,3 +349,4 @@ void MicroProfileDrawLine2D(u32 vertices_length, float* vertices, u32 hex_color) | |||
| 337 | mp_painter->drawPolyline(point_buf.data(), vertices_length); | 349 | mp_painter->drawPolyline(point_buf.data(), vertices_length); |
| 338 | point_buf.clear(); | 350 | point_buf.clear(); |
| 339 | } | 351 | } |
| 352 | #endif | ||
diff --git a/src/citra_qt/debugger/profiler.h b/src/citra_qt/debugger/profiler.h index 036054740..3b38ed8ec 100644 --- a/src/citra_qt/debugger/profiler.h +++ b/src/citra_qt/debugger/profiler.h | |||
| @@ -7,8 +7,10 @@ | |||
| 7 | #include <QAbstractItemModel> | 7 | #include <QAbstractItemModel> |
| 8 | #include <QDockWidget> | 8 | #include <QDockWidget> |
| 9 | #include <QTimer> | 9 | #include <QTimer> |
| 10 | |||
| 10 | #include "ui_profiler.h" | 11 | #include "ui_profiler.h" |
| 11 | 12 | ||
| 13 | #include "common/microprofile.h" | ||
| 12 | #include "common/profiler_reporting.h" | 14 | #include "common/profiler_reporting.h" |
| 13 | 15 | ||
| 14 | class ProfilerModel : public QAbstractItemModel | 16 | class ProfilerModel : public QAbstractItemModel |
| @@ -49,6 +51,7 @@ private: | |||
| 49 | QTimer update_timer; | 51 | QTimer update_timer; |
| 50 | }; | 52 | }; |
| 51 | 53 | ||
| 54 | |||
| 52 | class MicroProfileDialog : public QWidget { | 55 | class MicroProfileDialog : public QWidget { |
| 53 | Q_OBJECT | 56 | Q_OBJECT |
| 54 | 57 | ||
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 2ca1e51f6..f1ab29755 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -69,8 +69,10 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) | |||
| 69 | addDockWidget(Qt::BottomDockWidgetArea, profilerWidget); | 69 | addDockWidget(Qt::BottomDockWidgetArea, profilerWidget); |
| 70 | profilerWidget->hide(); | 70 | profilerWidget->hide(); |
| 71 | 71 | ||
| 72 | #if MICROPROFILE_ENABLED | ||
| 72 | microProfileDialog = new MicroProfileDialog(this); | 73 | microProfileDialog = new MicroProfileDialog(this); |
| 73 | microProfileDialog->hide(); | 74 | microProfileDialog->hide(); |
| 75 | #endif | ||
| 74 | 76 | ||
| 75 | disasmWidget = new DisassemblerWidget(this, emu_thread.get()); | 77 | disasmWidget = new DisassemblerWidget(this, emu_thread.get()); |
| 76 | addDockWidget(Qt::BottomDockWidgetArea, disasmWidget); | 78 | addDockWidget(Qt::BottomDockWidgetArea, disasmWidget); |
| @@ -110,7 +112,9 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) | |||
| 110 | 112 | ||
| 111 | QMenu* debug_menu = ui.menu_View->addMenu(tr("Debugging")); | 113 | QMenu* debug_menu = ui.menu_View->addMenu(tr("Debugging")); |
| 112 | debug_menu->addAction(profilerWidget->toggleViewAction()); | 114 | debug_menu->addAction(profilerWidget->toggleViewAction()); |
| 115 | #if MICROPROFILE_ENABLED | ||
| 113 | debug_menu->addAction(microProfileDialog->toggleViewAction()); | 116 | debug_menu->addAction(microProfileDialog->toggleViewAction()); |
| 117 | #endif | ||
| 114 | debug_menu->addAction(disasmWidget->toggleViewAction()); | 118 | debug_menu->addAction(disasmWidget->toggleViewAction()); |
| 115 | debug_menu->addAction(registersWidget->toggleViewAction()); | 119 | debug_menu->addAction(registersWidget->toggleViewAction()); |
| 116 | debug_menu->addAction(callstackWidget->toggleViewAction()); | 120 | debug_menu->addAction(callstackWidget->toggleViewAction()); |
| @@ -136,8 +140,10 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) | |||
| 136 | restoreGeometry(UISettings::values.geometry); | 140 | restoreGeometry(UISettings::values.geometry); |
| 137 | restoreState(UISettings::values.state); | 141 | restoreState(UISettings::values.state); |
| 138 | render_window->restoreGeometry(UISettings::values.renderwindow_geometry); | 142 | render_window->restoreGeometry(UISettings::values.renderwindow_geometry); |
| 143 | #if MICROPROFILE_ENABLED | ||
| 139 | microProfileDialog->restoreGeometry(UISettings::values.microprofile_geometry); | 144 | microProfileDialog->restoreGeometry(UISettings::values.microprofile_geometry); |
| 140 | microProfileDialog->setVisible(UISettings::values.microprofile_visible); | 145 | microProfileDialog->setVisible(UISettings::values.microprofile_visible); |
| 146 | #endif | ||
| 141 | 147 | ||
| 142 | game_list->LoadInterfaceLayout(); | 148 | game_list->LoadInterfaceLayout(); |
| 143 | 149 | ||
| @@ -511,9 +517,10 @@ void GMainWindow::closeEvent(QCloseEvent* event) { | |||
| 511 | UISettings::values.geometry = saveGeometry(); | 517 | UISettings::values.geometry = saveGeometry(); |
| 512 | UISettings::values.state = saveState(); | 518 | UISettings::values.state = saveState(); |
| 513 | UISettings::values.renderwindow_geometry = render_window->saveGeometry(); | 519 | UISettings::values.renderwindow_geometry = render_window->saveGeometry(); |
| 520 | #if MICROPROFILE_ENABLED | ||
| 514 | UISettings::values.microprofile_geometry = microProfileDialog->saveGeometry(); | 521 | UISettings::values.microprofile_geometry = microProfileDialog->saveGeometry(); |
| 515 | UISettings::values.microprofile_visible = microProfileDialog->isVisible(); | 522 | UISettings::values.microprofile_visible = microProfileDialog->isVisible(); |
| 516 | 523 | #endif | |
| 517 | UISettings::values.single_window_mode = ui.action_Single_Window_Mode->isChecked(); | 524 | UISettings::values.single_window_mode = ui.action_Single_Window_Mode->isChecked(); |
| 518 | UISettings::values.display_titlebar = ui.actionDisplay_widget_title_bars->isChecked(); | 525 | UISettings::values.display_titlebar = ui.actionDisplay_widget_title_bars->isChecked(); |
| 519 | UISettings::values.first_start = false; | 526 | UISettings::values.first_start = false; |
diff --git a/src/common/microprofile.h b/src/common/microprofile.h index d3b6cb97c..ef312c6e1 100644 --- a/src/common/microprofile.h +++ b/src/common/microprofile.h | |||
| @@ -4,6 +4,10 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | // Uncomment this to disable microprofile. This will get you cleaner profiles when using | ||
| 8 | // external sampling profilers like "Very Sleepy", and will improve performance somewhat. | ||
| 9 | // #define MICROPROFILE_ENABLED 0 | ||
| 10 | |||
| 7 | // Customized Citra settings. | 11 | // Customized Citra settings. |
| 8 | // This file wraps the MicroProfile header so that these are consistent everywhere. | 12 | // This file wraps the MicroProfile header so that these are consistent everywhere. |
| 9 | #define MICROPROFILE_WEBSERVER 0 | 13 | #define MICROPROFILE_WEBSERVER 0 |