summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.h')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h
index 0ef6a1ff54..0b92fd31d3 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.h
+++ b/Source/Core/VideoCommon/TextureCacheBase.h
@@ -43,7 +43,6 @@ public:
};
};
-
struct TCacheEntryBase
{
const TCacheEntryConfig config;
@@ -53,6 +52,7 @@ public:
u32 size_in_bytes;
u64 hash;
u32 format;
+ bool is_efb_copy;
unsigned int native_width, native_height; // Texture dimensions from the GameCube's point of view
unsigned int native_levels;
@@ -95,7 +95,7 @@ public:
bool OverlapsMemoryRange(u32 range_address, u32 range_size) const;
- bool IsEfbCopy() { return config.rendertarget; }
+ bool IsEfbCopy() { return is_efb_copy; }
};
virtual ~TextureCache(); // needs virtual for DX11 dtor
@@ -107,9 +107,7 @@ public:
static void Cleanup(int frameCount);
static void Invalidate();
- static void InvalidateRange(u32 start_address, u32 size);
static void MakeRangeDynamic(u32 start_address, u32 size);
- static void ClearRenderTargets(); // currently only used by OGL
virtual TCacheEntryBase* CreateTexture(const TCacheEntryConfig& config) = 0;
@@ -117,11 +115,15 @@ public:
virtual void DeleteShaders() = 0; // currently only implemented by OGL
static TCacheEntryBase* Load(const u32 stage);
+ static void UnbindTextures();
+ static void BindTextures();
static void CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat, PEControl::PixelFormat srcFormat,
const EFBRectangle& srcRect, bool isIntensity, bool scaleByHalf);
static void RequestInvalidateTextureCache();
+ virtual void ConvertTexture(TCacheEntryBase* entry, TCacheEntryBase* unconverted, void* palette, TlutFormat format) = 0;
+
protected:
TextureCache();
@@ -135,11 +137,14 @@ private:
static TCacheEntryBase* AllocateTexture(const TCacheEntryConfig& config);
static void FreeTexture(TCacheEntryBase* entry);
+ static TCacheEntryBase* ReturnEntry(unsigned int stage, TCacheEntryBase* entry);
+
typedef std::multimap<u32, TCacheEntryBase*> TexCache;
typedef std::unordered_multimap<TCacheEntryConfig, TCacheEntryBase*, TCacheEntryConfig::Hasher> TexPool;
static TexCache textures;
static TexPool texture_pool;
+ static TCacheEntryBase* bound_textures[8];
// Backup configuration values
static struct BackupConfig