From 6856fbbef76075e5d682aa48ec5989375386984a Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 30 Dec 2015 13:29:29 -0800 Subject: [PATCH] Show an OSM whenever VRAM fills up. This way they know stuff is happening that is not ideal. --- GPU/GLES/TextureCache.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index aeb413ac83..79a013bea0 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -19,10 +19,12 @@ #include #include "ext/xxhash.h" +#include "i18n/i18n.h" #include "math/math_util.h" #include "profiler/profiler.h" #include "Common/ColorConv.h" +#include "Core/Config.h" #include "Core/Host.h" #include "Core/MemMap.h" #include "Core/Reporting.h" @@ -36,8 +38,7 @@ #include "GPU/GLES/ShaderManager.h" #include "GPU/GLES/TransformPipeline.h" #include "GPU/Common/TextureDecoder.h" -#include "Core/Config.h" -#include "Core/Host.h" +#include "UI/OnScreenDisplay.h" #ifdef _M_SSE #include @@ -2007,6 +2008,16 @@ void TextureCache::LoadTextureLevel(TexCacheEntry &entry, int level, bool replac Decimate(); // Try again, now that we've cleared out textures in lowMemoryMode_. glTexImage2D(GL_TEXTURE_2D, level, components, w, h, 0, components2, dstFmt, pixelData); + + I18NCategory *err = GetI18NCategory("Error"); + if (scaleFactor > 1) { + osm.Show(err->T("Warning: Video memory FULL, reducing upscaling and switching to slow caching mode"), 2.0f); + } else { + osm.Show(err->T("Warning: Video memory FULL, switching to slow caching mode"), 2.0f); + } + } else if (err != GL_NO_ERROR) { + // We checked the err anyway, might as well log if there is one. + WARN_LOG(G3D, "Got an error in texture upload: %08x", err); } } }