diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2015-02-20 01:11:25 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2015-02-20 01:11:25 +0100 |
| commit | 8b095a0178b408cd3acab952958c85381180293a (patch) | |
| tree | 2bc88c42aa394cd3447ea8d592a818186299d0fb /Source/Core/VideoCommon/TextureCacheBase.h | |
| parent | 0360e01eaf917df16a00840aebb3b4a924778777 (diff) | |
| parent | 074397c12dd95b6c5119054ed6674043fb4641cc (diff) | |
Merge pull request #2059 from magumagu/palette-convert
Decode EFB copies used as paletted textures.
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.h')
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.h | 13 |
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 |
