Skip to content

Commit

Permalink
Add SPU Profiler to GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Apr 13, 2024
1 parent bf86393 commit d91da9f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rpcs3/Emu/CPU/CPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,13 @@ struct cpu_prof
continue;
}

if (!g_cfg.core.spu_debug)
{
// Reduce accuracy in favor of performance when enabled alone
thread_ctrl::wait_for(60, false);
continue;
}

// Wait, roughly for 20µs
thread_ctrl::wait_for(20, false);
}
Expand Down
2 changes: 2 additions & 0 deletions rpcs3/rpcs3qt/emu_settings_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ enum class emu_settings_type
AccuratePPUVNAN,
AccuratePPUFPCC,
MaxPreemptCount,
SPUProfiler,

// Graphics
Renderer,
Expand Down Expand Up @@ -237,6 +238,7 @@ inline static const QMap<emu_settings_type, cfg_location> settings_location =
{ emu_settings_type::AccuratePPUVNAN, { "Core", "PPU Accurate Vector NaN Values"}},
{ emu_settings_type::AccuratePPUFPCC, { "Core", "PPU Set FPCC Bits"}},
{ emu_settings_type::MaxPreemptCount, { "Core", "Max CPU Preempt Count"}},
{ emu_settings_type::SPUProfiler, { "Core", "SPU Profiler"}},

// Graphics Tab
{ emu_settings_type::Renderer, { "Video", "Renderer"}},
Expand Down
3 changes: 3 additions & 0 deletions rpcs3/rpcs3qt/settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,9 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
m_emu_settings->EnhanceCheckBox(ui->compatibleSavestates, emu_settings_type::CompatibleEmulationSavestateMode);
SubscribeTooltip(ui->compatibleSavestates, tooltips.settings.compatible_savestates);

m_emu_settings->EnhanceCheckBox(ui->spuProfiler, emu_settings_type::SPUProfiler);
SubscribeTooltip(ui->spuProfiler, tooltips.settings.spu_profiler);

m_emu_settings->EnhanceCheckBox(ui->silenceAllLogs, emu_settings_type::SilenceAllLogs);
SubscribeTooltip(ui->silenceAllLogs, tooltips.settings.silence_all_logs);

Expand Down
7 changes: 7 additions & 0 deletions rpcs3/rpcs3qt/settings_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="spuProfiler">
<property name="text">
<string>SPU Profiler</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="silenceAllLogs">
<property name="text">
Expand Down
1 change: 1 addition & 0 deletions rpcs3/rpcs3qt/tooltips.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Tooltips : public QObject
const QString suspend_savestates = tr("When this mode is on, emulation exits when saving and the savestate file is concealed after loading it, preventing reuse by RPCS3.\nThis mode is like hibernation of emulation: if you don't want to be able to cheat using savestates when playing the game, consider using this mode.\nDo note that the savestate file is not gone completely, just ignored by RPCS3. You can manually relaunch it if needed.");
const QString compatible_savestates = tr("When this mode is on, SPU emulation prioritizes savestate compatibility, however, it may reduce performance slightly.\nWhen this mode is off, some games may not allow making a savestate and show an SPU pause error in the log.");
const QString paused_savestates = tr("When this mode is on, savestates are loaded and paused on the first frame.\nThis allows players to prepare for gameplay without being thrown into the action immediately.");
const QString spu_profiler = tr("When enabled, SPU performance is measured at runtime.\nEnable only at a developr's request because when enabled it reduces performance a bit by itself.");

// audio

Expand Down

0 comments on commit d91da9f

Please sign in to comment.