Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Savestate Fixes part 3 out of 3 #14691

Merged
merged 3 commits into from
Oct 1, 2023
Merged

Savestate Fixes part 3 out of 3 #14691

merged 3 commits into from
Oct 1, 2023

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Sep 30, 2023

Makes savestates a thing again.

Fixes #14007

@elad335 elad335 added CPU Savestates Anything that involves savestates LLVM Related to LLVM instruction decoders Bugfix labels Sep 30, 2023
@Ordinary205
Copy link
Contributor

Ordinary205 commented Sep 30, 2023

The game does boot up properly, however this causes more time to build SPU caches, and the performance behaves slower on Midnight Club Los Angeles.

Master:
13 seconds to finish compiling SPU caches.
18.2/20.7/21.4 FPS
Midnight club los angeles performance master
RPCS3.log.gz

PR:
2 minutes 8 seconds to finish compiling SPU caches.
17.1/18.8/19.6 FPS
Midnight Club Los Angeles performance
RPCS3.log.gz

@@ -6071,10 +6170,11 @@ class spu_llvm_recompiler : public spu_recompiler_base, public cpu_translator

for (auto [a2, b2] : sucs)
{
auto ins = b2->block->getFirstNonPHI();

continue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

@@ -4474,6 +4474,11 @@ class spu_llvm_recompiler : public spu_recompiler_base, public cpu_translator

// Store instructions
std::array<llvm::StoreInst*, s_reg_max> store{};

// Store reordering/elimination protection
std::array<usz, s_reg_max> store_context_last_id = fill_array<usz>(0); // Protects against illegal forward ordering
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::array<usz, s_reg_max> store_context_last_id = fill_array<usz>(0); // Protects against illegal forward ordering
std::array<usz, s_reg_max> store_context_last_id{}; // Protects against illegal forward ordering

Copy link
Contributor Author

@elad335 elad335 Sep 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno what is wrong with being explicit, this is all constexpr anyways so compiler output should be the same.

@@ -52,6 +52,7 @@ class Tooltips : public QObject
const QString vulkan_async_scheduler = tr("Determines how to schedule GPU async compute jobs when using asynchronous streaming.\nUse 'Safe' mode for more spec compliant behavior at the cost of some CPU overhead. This setting works with all devices.\nUse 'Fast' to use a faster but hacky version. This option is internally disabled for NVIDIA GPUs due to causing GPU hangs.");
const QString disable_msl_fast_math = tr("Disables Fast Math for MSL shaders, which may violate the IEEE 754 standard.\nDisabling it may fix some artifacts, especially on Apple GPUs, at the cost of performance.");
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 is optimized for savestates suitability and compatibility instead at the cost of slight performance downgrade.\nIf this mode is off, attempting to make a savestate may result in an SPU pause error in the log that would disallow doing so for some games.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@elad335 elad335 force-pushed the bps branch 2 times, most recently from ecf99e4 to 4954d7e Compare September 30, 2023 19:42
@elad335 elad335 marked this pull request as ready for review September 30, 2023 19:42
@elad335
Copy link
Contributor Author

elad335 commented Sep 30, 2023

@Ordinary205 Retest.

@Ordinary205
Copy link
Contributor

Ordinary205 commented Oct 1, 2023

Still takes the exact same time when building SPU caches. But the performance is slightly better than the master.
SPU cache: 2 minutes 8 seconds.
19.2/21.1/21.6 FPS
Midnight Club LA performance
RPCS3.log.gz

@Ordinary205
Copy link
Contributor

The SPU caches can now be finished approximately 14 seconds.
And the performance is slightly the same.
RPCS3.log.gz

@elad335 elad335 merged commit 5baec6c into RPCS3:master Oct 1, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix CPU LLVM Related to LLVM instruction decoders Savestates Anything that involves savestates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Regression] Savestates
4 participants