Host: Reset imgui state when there's no frame to present

Prevents things getting into a messed up state internally where several
frames are buffered.
This commit is contained in:
Connor McLaughlin authored and refractionpcsx2 committed 2022-05-16 17:30:11 +01:00
1 parent a163c90f2b
commit 437b6f3f0e
2 files changed
+19 -2

No files matched your search

+9 -1
View File
@@ -716,7 +716,15 @@ void Host::ReleaseHostDisplay()
bool Host::BeginPresentFrame(bool frame_skip)
{
return s_host_display->BeginPresent(frame_skip);
if (!s_host_display->BeginPresent(frame_skip))
{
// if we're skipping a frame, we need to reset imgui's state, since
// we won't be calling EndPresentFrame().
ImGuiManager::NewFrame();
return false;
}
return true;
}
void Host::EndPresentFrame()
+10 -1
View File
@@ -153,7 +153,16 @@ HostDisplay* Host::GetHostDisplay()
bool Host::BeginPresentFrame(bool frame_skip)
{
CheckForGSWindowResize();
return s_host_display->BeginPresent(frame_skip);
if (!s_host_display->BeginPresent(frame_skip))
{
// if we're skipping a frame, we need to reset imgui's state, since
// we won't be calling EndPresentFrame().
ImGuiManager::NewFrame();
return false;
}
return true;
}
void Host::EndPresentFrame()