GS: Fix crash on shutdown when using software renderer

This commit is contained in:
Stenzek 2023-04-01 13:26:06 +10:00 committed by refractionpcsx2
parent e9a624ab54
commit 8989b69ce8
3 changed files with 5 additions and 4 deletions

View File

@ -108,6 +108,8 @@ void GSshutdown()
void GSclose()
{
GSTextureReplacements::Shutdown();
if (g_gs_renderer)
{
g_gs_renderer->Destroy();
@ -290,6 +292,7 @@ bool GSreopen(bool recreate_display, bool recreate_renderer, const Pcsx2Config::
const u32 gamecrc = g_gs_renderer->GetGameCRC();
if (recreate_renderer)
{
GSTextureReplacements::Shutdown();
g_gs_renderer->Destroy();
g_gs_renderer.reset();
}
@ -773,7 +776,8 @@ void GSUpdateConfig(const Pcsx2Config::GSOptions& new_config)
g_gs_device->ClearSamplerCache();
// texture dumping/replacement options
GSTextureReplacements::UpdateConfig(old_config);
if (GSConfig.UseHardwareRenderer())
GSTextureReplacements::UpdateConfig(old_config);
// clear the hash texture cache since we might have replacements now
// also clear it when dumping changes, since we want to dump everything being used

View File

@ -55,7 +55,6 @@ GSRendererHW::~GSRendererHW()
void GSRendererHW::Destroy()
{
g_texture_cache->RemoveAll();
GSTextureReplacements::Shutdown();
GSRenderer::Destroy();
}

View File

@ -47,8 +47,6 @@ GSTextureCache::GSTextureCache()
GSTextureCache::~GSTextureCache()
{
GSTextureReplacements::Shutdown();
RemoveAll();
_aligned_free(s_unswizzle_buffer);