Vulkan: Fix bug when stepping / pausing-on-lost-focus

This commit is contained in:
Henrik Rydgård committed 2024-05-29 14:49:53 +02:00
1 parent d29a2a2b8c
commit 53ebba4a3e
3 files changed
+12 -7

No files matched your search

+8 -6
View File
@@ -1348,7 +1348,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
// We only bind it in FramebufferManager::CopyDisplayToOutput (unless non-buffered)...
// We do, however, start the frame in other ways.
if ((skipBufferEffects && !g_Config.bSoftwareRendering) || Core_IsStepping()) {
if (skipBufferEffects && !g_Config.bSoftwareRendering) {
// We need to clear here already so that drawing during the frame is done on a clean slate.
if (Core_IsStepping() && gpuStats.numFlips != 0) {
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::KEEP, RPAction::CLEAR, RPAction::CLEAR }, "EmuScreen_BackBuffer");
@@ -1450,13 +1450,11 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
} else {
// If we're stepping, it's convenient not to clear the screen entirely, so we copy display to output.
// This won't work in non-buffered, but that's fine.
draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, clearColor }, "EmuScreen_Stepping");
framebufferBound = true;
// Just to make sure.
if (PSP_IsInited()) {
_dbg_assert_(gpu);
if (!framebufferBound && PSP_IsInited()) {
// draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, clearColor }, "EmuScreen_Stepping");
gpu->CopyDisplayToOutput(true);
}
framebufferBound = true;
}
break;
}
@@ -1468,6 +1466,10 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
break;
}
if (framebufferBound && gpu) {
gpu->PresentedThisFrame();
}
PSP_EndHostFrame();
// This place rougly matches how libretro handles it (after retro_frame).
+3
View File
@@ -1224,7 +1224,10 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
systemSettings->Add(new CheckBox(&g_Config.bCacheFullIsoInRam, sy->T("Cache ISO in RAM", "Cache full ISO in RAM")))->SetEnabled(!PSP_IsInited());
systemSettings->Add(new CheckBox(&g_Config.bCheckForNewVersion, sy->T("VersionCheck", "Check for new versions of PPSSPP")));
systemSettings->Add(new CheckBox(&g_Config.bScreenshotsAsPNG, sy->T("Screenshots as PNG")));
// TODO: Make this setting available on Mac too.
#if PPSSPP_PLATFORM(WINDOWS)
systemSettings->Add(new CheckBox(&g_Config.bPauseOnLostFocus, sy->T("Pause when not focused")));
#endif
systemSettings->Add(new ItemHeader(sy->T("Cheats", "Cheats")));
CheckBox *enableCheats = systemSettings->Add(new CheckBox(&g_Config.bEnableCheats, sy->T("Enable Cheats")));
+1 -1
View File
@@ -844,7 +844,7 @@ namespace MainWindow
g_activeWindow = WINDOW_OTHER;
}
if (!noFocusPause && g_Config.bPauseOnLostFocus && GetUIState() == UISTATE_INGAME) {
if (pause != Core_IsStepping()) { // != is xor for bools
if (pause != Core_IsStepping()) {
if (disasmWindow)
SendMessage(disasmWindow->GetDlgHandle(), WM_COMMAND, IDC_STOPGO, 0);
else