mirror of https://github.com/PCSX2/pcsx2.git
GS: Auto-disable hash cache when it's too large
This commit is contained in:
parent
b389c6e103
commit
ee82c7834d
|
@ -16,6 +16,7 @@
|
|||
#include "PrecompiledHeader.h"
|
||||
#include "GSRendererHW.h"
|
||||
#include "GS/GSGL.h"
|
||||
#include "Host.h"
|
||||
|
||||
GSRendererHW::GSRendererHW()
|
||||
: GSRenderer()
|
||||
|
@ -313,6 +314,15 @@ void GSRendererHW::VSync(u32 field, bool registers_written)
|
|||
|
||||
m_tc->IncAge();
|
||||
|
||||
if (m_tc->GetHashCacheMemoryUsage() > 1024 * 1024 * 1024)
|
||||
{
|
||||
Host::AddKeyedFormattedOSDMessage("HashCacheOverflow", 15.0f, "Hash cache has used %.2f MB of VRAM, disabling.",
|
||||
static_cast<float>(m_tc->GetHashCacheMemoryUsage()) / 1048576.0f);
|
||||
m_tc->RemoveAll();
|
||||
g_gs_device->PurgePool();
|
||||
GSConfig.TexturePreloading = TexturePreloadingLevel::Partial;
|
||||
}
|
||||
|
||||
m_tc->PrintMemoryUsage();
|
||||
g_gs_device->PrintMemoryUsage();
|
||||
|
||||
|
|
Loading…
Reference in New Issue