Instead of invalidating texcache whenever the graphics configuration dialog gets opened, clean up textures on configuration changes.

This commit is contained in:
NeoBrainX
2012-05-28 11:31:37 +02:00
parent 30de244050
commit 8d30ac462a
8 changed files with 61 additions and 24 deletions

View File

@ -27,6 +27,8 @@
#include "CommonTypes.h"
struct VideoConfig;
class TextureCache
{
public:
@ -100,10 +102,10 @@ public:
virtual ~TextureCache(); // needs virtual for DX11 dtor
static void OnConfigChanged(VideoConfig& config);
static void Cleanup();
static void Invalidate(bool shutdown);
static void InvalidateDefer();
static void InvalidateRange(u32 start_address, u32 size);
static void MakeRangeDynamic(u32 start_address, u32 size);
static void ClearRenderTargets(); // currently only used by OGL
@ -118,8 +120,6 @@ public:
static void CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat, unsigned int srcFormat,
const EFBRectangle& srcRect, bool isIntensity, bool scaleByHalf);
static bool DeferredInvalidate;
protected:
TextureCache();
@ -135,6 +135,19 @@ private:
typedef std::map<u32, TCacheEntryBase*> TexCache;
static TexCache textures;
// Backup configuration values
static struct BackupConfig {
int s_colorsamples;
bool s_copy_efb_to_texture;
bool s_copy_efb_scaled;
bool s_copy_efb;
int s_efb_scale;
bool s_texfmt_overlay;
bool s_texfmt_overlay_center;
bool s_hires_textures;
bool s_copy_cache_enable;
} backup_config;
};
extern TextureCache *g_texture_cache;