Skip to content

Commit

Permalink
GS/Capture: Stop capture on VM shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Jan 28, 2024
1 parent fb3a9ea commit 63872e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pcsx2/GS/GS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "GS/Renderers/Null/GSRendererNull.h"
#include "GS/Renderers/HW/GSRendererHW.h"
#include "GS/Renderers/HW/GSTextureReplacements.h"
#include "VMManager.h"

#ifdef ENABLE_OPENGL
#include "GS/Renderers/OpenGL/GSDeviceOGL.h"
Expand Down Expand Up @@ -333,6 +334,9 @@ bool GSopen(const Pcsx2Config::GSOptions& config, GSRendererType renderer, u8* b

void GSclose()
{
if (GSCapture::IsCapturing())
GSCapture::EndCapture();

CloseGSRenderer();
CloseGSDevice(true);
Host::ReleaseRenderWindow();
Expand Down Expand Up @@ -492,6 +496,9 @@ void GSGameChanged()
{
if (GSIsHardwareRenderer())
GSTextureReplacements::GameChanged();

if (!VMManager::HasValidVM() && GSCapture::IsCapturing())
GSCapture::EndCapture();
}

bool GSHasDisplayWindow()
Expand Down
1 change: 1 addition & 0 deletions pcsx2/VMManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,7 @@ void VMManager::Shutdown(bool save_resume_state)
{
MTGS::WaitGS(false, false, false);
MTGS::ResetGS(true);
MTGS::GameChanged();
}
else
{
Expand Down

0 comments on commit 63872e6

Please sign in to comment.