mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-21 18:29:05 +02:00
EmuScreen: Restart after a failed savestate load before drawing the frame
The restart shut the GPU down after PrepareCopyDisplayToOutput had bound its pipelines in the open backbuffer pass, which trips the pipelinesToCheck_ assert in VulkanRenderManager::CheckNothingPending. The failed load already stops the frame from running, so nothing is lost by restarting first. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
23a5f317bd
commit
deb9693f6a
1 file changed
+19
-16
+19
-16
@@ -1781,6 +1781,25 @@ ScreenRenderFlags EmuScreen::RunEmulation(bool skipBufferEffects) {
|
||||
// We process savestates before running the frame.
|
||||
SaveState::Process();
|
||||
|
||||
// A savestate that failed to load halfway leaves a reset as the only option. Do it before the frame
|
||||
// draws anything: the GPU can't shut down while its pipelines are bound in the open backbuffer pass.
|
||||
if (SaveState::PollRestartNeeded() && !bootPending_) {
|
||||
Achievements::UnloadGame();
|
||||
PSP_Shutdown(true);
|
||||
|
||||
// Restart the boot process
|
||||
bootPending_ = true;
|
||||
bootIsReset_ = true;
|
||||
RecreateViews();
|
||||
_dbg_assert_(coreState == CORE_POWERDOWN);
|
||||
if (!PSP_InitStart(PSP_CoreParameter())) {
|
||||
bootPending_ = false;
|
||||
WARN_LOG(Log::Loader, "Error resetting");
|
||||
screenManager()->switchScreen(new MainScreen());
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
if (gpu) {
|
||||
gpu->BeginHostFrame(displayLayoutConfig);
|
||||
}
|
||||
@@ -1858,22 +1877,6 @@ ScreenRenderFlags EmuScreen::RunEmulation(bool skipBufferEffects) {
|
||||
draw->BindFramebufferAsRenderTarget(nullptr, {RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR}, "BackBuffer");
|
||||
}
|
||||
}
|
||||
|
||||
if (SaveState::PollRestartNeeded() && !bootPending_) {
|
||||
Achievements::UnloadGame();
|
||||
PSP_Shutdown(true);
|
||||
|
||||
// Restart the boot process
|
||||
bootPending_ = true;
|
||||
bootIsReset_ = true;
|
||||
RecreateViews();
|
||||
_dbg_assert_(coreState == CORE_POWERDOWN);
|
||||
if (!PSP_InitStart(PSP_CoreParameter())) {
|
||||
bootPending_ = false;
|
||||
WARN_LOG(Log::Loader, "Error resetting");
|
||||
screenManager()->switchScreen(new MainScreen());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (frameStep_) {
|
||||
|
||||
Reference in new issue
Block a user