Browse Source

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.
master
Connor McLaughlin 1 month ago committed by refractionpcsx2
parent
commit
437b6f3f0e
  1. 10
      pcsx2-qt/EmuThread.cpp
  2. 11
      pcsx2/gui/AppHost.cpp

10
pcsx2-qt/EmuThread.cpp

@ -716,7 +716,15 @@ void Host::ReleaseHostDisplay() @@ -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()

11
pcsx2/gui/AppHost.cpp

@ -153,7 +153,16 @@ HostDisplay* Host::GetHostDisplay() @@ -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()

Loading…
Cancel
Save