GS: Hardware reset on load state

Stops unnecessary readbacks.
This commit is contained in:
Stenzek 2023-07-19 17:26:42 +10:00 committed by Connor McLaughlin
parent c72329d990
commit 1a16a527b3
3 changed files with 12 additions and 12 deletions

View File

@ -357,6 +357,17 @@ void GSclose()
void GSreset(bool hardware_reset) void GSreset(bool hardware_reset)
{ {
g_gs_renderer->Reset(hardware_reset); g_gs_renderer->Reset(hardware_reset);
// Restart video capture if it's been started.
// Otherwise we get a buildup of audio frames from the CPU thread.
if (hardware_reset && GSCapture::IsCapturing())
{
std::string next_filename = GSCapture::GetNextCaptureFileName();
const GSVector2i size = GSCapture::GetSize();
Console.Warning(fmt::format("Restarting video capture to {}.", next_filename));
g_gs_renderer->EndCapture();
g_gs_renderer->BeginCapture(std::move(next_filename), size);
}
} }
void GSgifSoftReset(u32 mask) void GSgifSoftReset(u32 mask)

View File

@ -2531,7 +2531,7 @@ int GSState::Defrost(const freezeData* fd)
Flush(GSFlushReason::LOADSTATE); Flush(GSFlushReason::LOADSTATE);
Reset(false); Reset(true);
ReadState(&m_env.PRIM, data); ReadState(&m_env.PRIM, data);

View File

@ -80,17 +80,6 @@ void GSRenderer::Reset(bool hardware_reset)
g_gs_device->ClearCurrent(); g_gs_device->ClearCurrent();
GSState::Reset(hardware_reset); GSState::Reset(hardware_reset);
// Restart video capture if it's been started.
// Otherwise we get a buildup of audio frames from the CPU thread.
if (hardware_reset && GSCapture::IsCapturing())
{
std::string next_filename = GSCapture::GetNextCaptureFileName();
const GSVector2i size = GSCapture::GetSize();
Console.Warning(fmt::format("Restarting video capture to {}.", next_filename));
EndCapture();
BeginCapture(std::move(next_filename), size);
}
} }
void GSRenderer::Destroy() void GSRenderer::Destroy()