GS/Capture: Stop capture on VM shutdown

This commit is contained in:
Stenzek 2024-01-28 20:49:35 +10:00 committed by Connor McLaughlin
parent fb3a9eae9b
commit 63872e6b28
2 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include "GS/Renderers/Null/GSRendererNull.h" #include "GS/Renderers/Null/GSRendererNull.h"
#include "GS/Renderers/HW/GSRendererHW.h" #include "GS/Renderers/HW/GSRendererHW.h"
#include "GS/Renderers/HW/GSTextureReplacements.h" #include "GS/Renderers/HW/GSTextureReplacements.h"
#include "VMManager.h"
#ifdef ENABLE_OPENGL #ifdef ENABLE_OPENGL
#include "GS/Renderers/OpenGL/GSDeviceOGL.h" #include "GS/Renderers/OpenGL/GSDeviceOGL.h"
@ -333,6 +334,9 @@ bool GSopen(const Pcsx2Config::GSOptions& config, GSRendererType renderer, u8* b
void GSclose() void GSclose()
{ {
if (GSCapture::IsCapturing())
GSCapture::EndCapture();
CloseGSRenderer(); CloseGSRenderer();
CloseGSDevice(true); CloseGSDevice(true);
Host::ReleaseRenderWindow(); Host::ReleaseRenderWindow();
@ -492,6 +496,9 @@ void GSGameChanged()
{ {
if (GSIsHardwareRenderer()) if (GSIsHardwareRenderer())
GSTextureReplacements::GameChanged(); GSTextureReplacements::GameChanged();
if (!VMManager::HasValidVM() && GSCapture::IsCapturing())
GSCapture::EndCapture();
} }
bool GSHasDisplayWindow() bool GSHasDisplayWindow()

View File

@ -1537,6 +1537,7 @@ void VMManager::Shutdown(bool save_resume_state)
{ {
MTGS::WaitGS(false, false, false); MTGS::WaitGS(false, false, false);
MTGS::ResetGS(true); MTGS::ResetGS(true);
MTGS::GameChanged();
} }
else else
{ {