mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-07-10 01:54:46 -06:00
SPU/PPU: Implement PPU reservation priority over SPUs
This commit is contained in:
parent
57b4687ac2
commit
e379fba97d
@ -8721,7 +8721,7 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point, s
|
||||
// This difference cannot be known at analyzer time but from observing callers.
|
||||
static constexpr std::initializer_list<std::string_view> allowed_patterns =
|
||||
{
|
||||
"620oYSe8uQqq9eTkhWfMqoEXX0us"sv, // CellSpurs JobChain acquire pattern
|
||||
"disabled_620oYSe8uQqq9eTkhWfMqoEXX0us"sv, // CellSpurs JobChain acquire pattern (disabled for now)
|
||||
};
|
||||
|
||||
allow_pattern = std::any_of(allowed_patterns.begin(), allowed_patterns.end(), FN(pattern_hash == x));
|
||||
|
||||
@ -483,6 +483,14 @@ namespace vm
|
||||
{
|
||||
auto& bits = get_range_lock_bits(true);
|
||||
|
||||
if (!!bits)
|
||||
{
|
||||
if (i == 0 && g_cfg.core.ppu_reservation_priority_over_spu)
|
||||
{
|
||||
busy_wait(5000);
|
||||
}
|
||||
}
|
||||
|
||||
if (!range_lock)
|
||||
{
|
||||
if (!bits && bits.compare_and_swap_test(0, u64{umax}))
|
||||
|
||||
@ -41,6 +41,7 @@ struct cfg_root : cfg::node
|
||||
cfg::_bool spu_accurate_reservations{ this, "Accurate SPU Reservations", true };
|
||||
cfg::_bool accurate_cache_line_stores{ this, "Accurate Cache Line Stores", false };
|
||||
cfg::_bool rsx_accurate_res_access{this, "Accurate RSX reservation access", false, true};
|
||||
cfg::_bool ppu_reservation_priority_over_spu{this, "PPU Reservation Priority Over SPUs", false, true};
|
||||
|
||||
struct fifo_setting : public cfg::_enum<rsx_fifo_mode>
|
||||
{
|
||||
|
||||
@ -58,6 +58,7 @@ const std::map<emu_settings_type, cfg_location> settings_location =
|
||||
{ emu_settings_type::SPUProfiler, get_cfg_location(local_cfg.core.spu_prof) },
|
||||
{ emu_settings_type::DisableSpinOptimization, get_cfg_location(local_cfg.core.spu_getllar_spin_optimization_disabled) },
|
||||
{ emu_settings_type::EnabledSPUEventsBusyLoop, get_cfg_location(local_cfg.core.spu_reservation_busy_waiting_enabled) },
|
||||
{ emu_settings_type::PPUReservationPriorityOverSPUs, get_cfg_location(local_cfg.core.ppu_reservation_priority_over_spu) },
|
||||
|
||||
// Graphics Tab
|
||||
{ emu_settings_type::Renderer, get_cfg_location(local_cfg.video.renderer) },
|
||||
|
||||
@ -52,6 +52,7 @@ enum class emu_settings_type
|
||||
SPUProfiler,
|
||||
DisableSpinOptimization,
|
||||
EnabledSPUEventsBusyLoop,
|
||||
PPUReservationPriorityOverSPUs,
|
||||
|
||||
// Graphics
|
||||
Renderer,
|
||||
|
||||
@ -260,6 +260,9 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
||||
m_emu_settings->EnhanceCheckBox(ui->spuLoopDetection, emu_settings_type::SPULoopDetection);
|
||||
SubscribeTooltip(ui->spuLoopDetection, tooltips.settings.spu_loop_detection);
|
||||
|
||||
m_emu_settings->EnhanceCheckBox(ui->ppuReservationPrority, emu_settings_type::PPUReservationPriorityOverSPUs);
|
||||
SubscribeTooltip(ui->ppuReservationPrority, tooltips.settings.ppu_reservation_priority);
|
||||
|
||||
// Comboboxes
|
||||
m_emu_settings->EnhanceComboBox(ui->xfloatAccuracy, emu_settings_type::XFloatAccuracy);
|
||||
SubscribeTooltip(ui->gb_xfloat_accuracy, tooltips.settings.xfloat);
|
||||
|
||||
@ -2519,6 +2519,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ppuReservationPrority">
|
||||
<property name="text">
|
||||
<string>PPU Reservation Priority</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="llvmPrecompilation">
|
||||
<property name="text">
|
||||
|
||||
@ -96,6 +96,7 @@ public:
|
||||
const QString spu_block_size = tr("This option controls the SPU analyser, particularly the size of compiled units. The Mega and Giga modes may improve performance by tying smaller units together, decreasing the number of compiled units but increasing their size.\nUse the Safe mode for maximum compatibility.");
|
||||
const QString preferred_spu_threads = tr("Some SPU stages are sensitive to race conditions and allowing a limited number at a time helps alleviate performance stalls.\nSetting this to a smaller value might improve performance and reduce stuttering in some games.\nLeave this on auto if performance is negatively affected when setting a small value.");
|
||||
const QString max_cpu_preempt = tr("Reduces CPU usage and power consumption, improving battery life on mobile devices. (0 means disabled)\nHigher values cause a more pronounced effect, but may cause audio or performance issues. A value of 50 or less is recommended.\nThis option forces an FPS limit because it's active when framerate is stable.\nThe lighter the game is on the hardware, the more power is saved by it. (until the preemption count barrier is reached)");
|
||||
const QString ppu_reservation_priority = tr("Give PPUs an execution advantage when the SPUs are using reservations.\nThis setting is recommended only for a few game for improving performance.\nDO NOT use it without being advised to due to potential performance degradation.");
|
||||
|
||||
// debug
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user