summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2015-11-06 01:28:05 +0100
committerTillmann Karras <tilkax@gmail.com>2015-11-06 15:43:58 +0100
commit81d9cce70c5a41b2791ab9cd5e69d4732becc34d (patch)
tree1d704154ce6192ab1c2b1f69ddf846127c0cc59f /Source/Core/VideoCommon
parentf26b3708e7c4979dc9a7cb5d0a6b55ee68cf637d (diff)
VideoCommon: rename TextureCache to TextureCacheBase
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/BPStructs.cpp6
-rw-r--r--Source/Core/VideoCommon/MainBase.cpp2
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp2
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp70
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.h10
-rw-r--r--Source/Core/VideoCommon/VertexManagerBase.cpp6
6 files changed, 48 insertions, 48 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp
index 0b94fcc2cc..6dc505c28e 100644
--- a/Source/Core/VideoCommon/BPStructs.cpp
+++ b/Source/Core/VideoCommon/BPStructs.cpp
@@ -224,9 +224,9 @@ static void BPWritten(const BPCmd& bp)
if (PE_copy.copy_to_xfb == 0)
{
// bpmem.zcontrol.pixel_format to PEControl::Z24 is when the game wants to copy from ZBuffer (Zbuffer uses 24-bit Format)
- TextureCache::CopyRenderTargetToTexture(destAddr, PE_copy.tp_realFormat(), destStride,
- bpmem.zcontrol.pixel_format, srcRect,
- !!PE_copy.intensity_fmt, !!PE_copy.half_scale);
+ TextureCacheBase::CopyRenderTargetToTexture(destAddr, PE_copy.tp_realFormat(), destStride,
+ bpmem.zcontrol.pixel_format, srcRect,
+ !!PE_copy.intensity_fmt, !!PE_copy.half_scale);
}
else
{
diff --git a/Source/Core/VideoCommon/MainBase.cpp b/Source/Core/VideoCommon/MainBase.cpp
index fc36906cdb..72ba4c5bef 100644
--- a/Source/Core/VideoCommon/MainBase.cpp
+++ b/Source/Core/VideoCommon/MainBase.cpp
@@ -227,7 +227,7 @@ void VideoBackendHardware::CheckInvalidState()
m_invalid = false;
BPReload();
- TextureCache::Invalidate();
+ TextureCacheBase::Invalidate();
}
}
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 75d646adc7..89bfa4dce1 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -88,7 +88,7 @@ Renderer::Renderer()
, bLastFrameDumped(false)
{
UpdateActiveConfig();
- TextureCache::OnConfigChanged(g_ActiveConfig);
+ TextureCacheBase::OnConfigChanged(g_ActiveConfig);
#if defined _WIN32 || defined HAVE_LIBAV
bAVIDumping = false;
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index c404e0d4df..9ed4a72261 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -28,25 +28,25 @@ static const int TEXTURE_KILL_THRESHOLD = 64; // Sonic the Fighters (inside Soni
static const int TEXTURE_POOL_KILL_THRESHOLD = 3;
static const int FRAMECOUNT_INVALID = 0;
-TextureCache* g_texture_cache;
+TextureCacheBase* g_texture_cache;
-alignas(16) u8* TextureCache::temp = nullptr;
-size_t TextureCache::temp_size;
+alignas(16) u8* TextureCacheBase::temp = nullptr;
+size_t TextureCacheBase::temp_size;
-TextureCache::TexCache TextureCache::textures_by_address;
-TextureCache::TexCache TextureCache::textures_by_hash;
-TextureCache::TexPool TextureCache::texture_pool;
-TextureCache::TCacheEntryBase* TextureCache::bound_textures[8];
+TextureCacheBase::TexCache TextureCacheBase::textures_by_address;
+TextureCacheBase::TexCache TextureCacheBase::textures_by_hash;
+TextureCacheBase::TexPool TextureCacheBase::texture_pool;
+TextureCacheBase::TCacheEntryBase* TextureCacheBase::bound_textures[8];
-TextureCache::BackupConfig TextureCache::backup_config;
+TextureCacheBase::BackupConfig TextureCacheBase::backup_config;
static bool invalidate_texture_cache_requested;
-TextureCache::TCacheEntryBase::~TCacheEntryBase()
+TextureCacheBase::TCacheEntryBase::~TCacheEntryBase()
{
}
-void TextureCache::CheckTempSize(size_t required_size)
+void TextureCacheBase::CheckTempSize(size_t required_size)
{
if (required_size <= temp_size)
return;
@@ -56,7 +56,7 @@ void TextureCache::CheckTempSize(size_t required_size)
temp = (u8*)AllocateAlignedMemory(temp_size, 16);
}
-TextureCache::TextureCache()
+TextureCacheBase::TextureCacheBase()
{
temp_size = 2048 * 2048 * 4;
if (!temp)
@@ -71,12 +71,12 @@ TextureCache::TextureCache()
invalidate_texture_cache_requested = false;
}
-void TextureCache::RequestInvalidateTextureCache()
+void TextureCacheBase::RequestInvalidateTextureCache()
{
invalidate_texture_cache_requested = true;
}
-void TextureCache::Invalidate()
+void TextureCacheBase::Invalidate()
{
UnbindTextures();
@@ -94,7 +94,7 @@ void TextureCache::Invalidate()
texture_pool.clear();
}
-TextureCache::~TextureCache()
+TextureCacheBase::~TextureCacheBase()
{
HiresTexture::Shutdown();
Invalidate();
@@ -102,7 +102,7 @@ TextureCache::~TextureCache()
temp = nullptr;
}
-void TextureCache::OnConfigChanged(VideoConfig& config)
+void TextureCacheBase::OnConfigChanged(VideoConfig& config)
{
if (g_texture_cache)
{
@@ -143,7 +143,7 @@ void TextureCache::OnConfigChanged(VideoConfig& config)
backup_config.s_efb_mono_depth = config.bStereoEFBMonoDepth;
}
-void TextureCache::Cleanup(int _frameCount)
+void TextureCacheBase::Cleanup(int _frameCount)
{
TexCache::iterator iter = textures_by_address.begin();
TexCache::iterator tcend = textures_by_address.end();
@@ -201,7 +201,7 @@ void TextureCache::Cleanup(int _frameCount)
}
}
-bool TextureCache::TCacheEntryBase::OverlapsMemoryRange(u32 range_address, u32 range_size) const
+bool TextureCacheBase::TCacheEntryBase::OverlapsMemoryRange(u32 range_address, u32 range_size) const
{
if (addr + size_in_bytes <= range_address)
return false;
@@ -212,7 +212,7 @@ bool TextureCache::TCacheEntryBase::OverlapsMemoryRange(u32 range_address, u32 r
return true;
}
-TextureCache::TCacheEntryBase* TextureCache::DoPartialTextureUpdates(TexCache::iterator iter_t)
+TextureCacheBase::TCacheEntryBase* TextureCacheBase::DoPartialTextureUpdates(TexCache::iterator iter_t)
{
TCacheEntryBase* entry_to_update = iter_t->second;
const bool isPaletteTexture = (entry_to_update->format == GX_TF_C4
@@ -272,7 +272,7 @@ TextureCache::TCacheEntryBase* TextureCache::DoPartialTextureUpdates(TexCache::i
}
if (entry_to_update->config.width != w || entry_to_update->config.height != h)
{
- TextureCache::TCacheEntryConfig newconfig;
+ TextureCacheBase::TCacheEntryConfig newconfig;
newconfig.width = w;
newconfig.height = h;
newconfig.rendertarget = true;
@@ -315,7 +315,7 @@ TextureCache::TCacheEntryBase* TextureCache::DoPartialTextureUpdates(TexCache::i
return entry_to_update;
}
-void TextureCache::DumpTexture(TCacheEntryBase* entry, std::string basename, unsigned int level)
+void TextureCacheBase::DumpTexture(TCacheEntryBase* entry, std::string basename, unsigned int level)
{
std::string szDir = File::GetUserPath(D_DUMPTEXTURES_IDX) +
SConfig::GetInstance().m_strUniqueID;
@@ -339,8 +339,8 @@ static u32 CalculateLevelSize(u32 level_0_size, u32 level)
return (level_0_size + ((1 << level) - 1)) >> level;
}
-// Used by TextureCache::Load
-TextureCache::TCacheEntryBase* TextureCache::ReturnEntry(unsigned int stage, TCacheEntryBase* entry)
+// Used by TextureCacheBase::Load
+TextureCacheBase::TCacheEntryBase* TextureCacheBase::ReturnEntry(unsigned int stage, TCacheEntryBase* entry)
{
entry->frameCount = FRAMECOUNT_INVALID;
bound_textures[stage] = entry;
@@ -350,7 +350,7 @@ TextureCache::TCacheEntryBase* TextureCache::ReturnEntry(unsigned int stage, TCa
return entry;
}
-void TextureCache::BindTextures()
+void TextureCacheBase::BindTextures()
{
for (int i = 0; i < 8; ++i)
{
@@ -359,12 +359,12 @@ void TextureCache::BindTextures()
}
}
-void TextureCache::UnbindTextures()
+void TextureCacheBase::UnbindTextures()
{
std::fill(std::begin(bound_textures), std::end(bound_textures), nullptr);
}
-TextureCache::TCacheEntryBase* TextureCache::Load(const u32 stage)
+TextureCacheBase::TCacheEntryBase* TextureCacheBase::Load(const u32 stage)
{
const FourTexUnits &tex = bpmem.tex[stage >> 2];
const u32 id = stage & 3;
@@ -724,8 +724,8 @@ TextureCache::TCacheEntryBase* TextureCache::Load(const u32 stage)
return ReturnEntry(stage, entry);
}
-void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat, u32 dstStride, PEControl::PixelFormat srcFormat,
- const EFBRectangle& srcRect, bool isIntensity, bool scaleByHalf)
+void TextureCacheBase::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat, u32 dstStride, PEControl::PixelFormat srcFormat,
+ const EFBRectangle& srcRect, bool isIntensity, bool scaleByHalf)
{
// Emulation methods:
//
@@ -1101,10 +1101,10 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
textures_by_address.emplace((u64)dstAddr, entry);
}
-TextureCache::TCacheEntryBase* TextureCache::AllocateTexture(const TCacheEntryConfig& config)
+TextureCacheBase::TCacheEntryBase* TextureCacheBase::AllocateTexture(const TCacheEntryConfig& config)
{
TexPool::iterator iter = texture_pool.find(config);
- TextureCache::TCacheEntryBase* entry;
+ TextureCacheBase::TCacheEntryBase* entry;
if (iter != texture_pool.end())
{
entry = iter->second;
@@ -1120,7 +1120,7 @@ TextureCache::TCacheEntryBase* TextureCache::AllocateTexture(const TCacheEntryCo
return entry;
}
-TextureCache::TexCache::iterator TextureCache::FreeTexture(TexCache::iterator iter)
+TextureCacheBase::TexCache::iterator TextureCacheBase::FreeTexture(TexCache::iterator iter)
{
TCacheEntryBase* entry = iter->second;
@@ -1136,7 +1136,7 @@ TextureCache::TexCache::iterator TextureCache::FreeTexture(TexCache::iterator it
return textures_by_address.erase(iter);
}
-u32 TextureCache::TCacheEntryBase::BytesPerRow() const
+u32 TextureCacheBase::TCacheEntryBase::BytesPerRow() const
{
const u32 blockW = TexDecoder_GetBlockWidthInTexels(format);
@@ -1151,7 +1151,7 @@ u32 TextureCache::TCacheEntryBase::BytesPerRow() const
return numBlocksX * bytes_per_block;
}
-u32 TextureCache::TCacheEntryBase::NumBlocksY() const
+u32 TextureCacheBase::TCacheEntryBase::NumBlocksY() const
{
u32 blockH = TexDecoder_GetBlockHeightInTexels(format);
// Round up source height to multiple of block size
@@ -1160,7 +1160,7 @@ u32 TextureCache::TCacheEntryBase::NumBlocksY() const
return actualHeight / blockH;
}
-void TextureCache::TCacheEntryBase::SetEfbCopy(u32 stride)
+void TextureCacheBase::TCacheEntryBase::SetEfbCopy(u32 stride)
{
is_efb_copy = true;
memory_stride = stride;
@@ -1171,7 +1171,7 @@ void TextureCache::TCacheEntryBase::SetEfbCopy(u32 stride)
}
// Fill gamecube memory backing this texture with zeros.
-void TextureCache::TCacheEntryBase::Zero(u8* ptr)
+void TextureCacheBase::TCacheEntryBase::Zero(u8* ptr)
{
for (u32 i = 0; i < NumBlocksY(); i++)
{
@@ -1180,7 +1180,7 @@ void TextureCache::TCacheEntryBase::Zero(u8* ptr)
}
}
-u64 TextureCache::TCacheEntryBase::CalculateHash() const
+u64 TextureCacheBase::TCacheEntryBase::CalculateHash() const
{
u8* ptr = Memory::GetPointer(addr);
if (memory_stride == BytesPerRow())
diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h
index e7d274818c..9ecb61c8ae 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.h
+++ b/Source/Core/VideoCommon/TextureCacheBase.h
@@ -17,7 +17,7 @@
struct VideoConfig;
-class TextureCache
+class TextureCacheBase
{
public:
struct TCacheEntryConfig
@@ -35,7 +35,7 @@ public:
struct Hasher : std::hash<u64>
{
- size_t operator()(const TextureCache::TCacheEntryConfig& c) const
+ size_t operator()(const TextureCacheBase::TCacheEntryConfig& c) const
{
u64 id = (u64)c.rendertarget << 63 | (u64)c.layers << 48 | (u64)c.levels << 32 | (u64)c.height << 16 | (u64)c.width;
return std::hash<u64>::operator()(id);
@@ -118,7 +118,7 @@ public:
u64 CalculateHash() const;
};
- virtual ~TextureCache(); // needs virtual for DX11 dtor
+ virtual ~TextureCacheBase(); // needs virtual for DX11 dtor
static void OnConfigChanged(VideoConfig& config);
@@ -144,7 +144,7 @@ public:
virtual void ConvertTexture(TCacheEntryBase* entry, TCacheEntryBase* unconverted, void* palette, TlutFormat format) = 0;
protected:
- TextureCache();
+ TextureCacheBase();
alignas(16) static u8* temp;
static size_t temp_size;
@@ -180,4 +180,4 @@ private:
} backup_config;
};
-extern TextureCache *g_texture_cache;
+extern TextureCacheBase* g_texture_cache;
diff --git a/Source/Core/VideoCommon/VertexManagerBase.cpp b/Source/Core/VideoCommon/VertexManagerBase.cpp
index 973e93e9b4..84f24cd6e2 100644
--- a/Source/Core/VideoCommon/VertexManagerBase.cpp
+++ b/Source/Core/VideoCommon/VertexManagerBase.cpp
@@ -211,10 +211,10 @@ void VertexManagerBase::Flush()
if (bpmem.tevind[i].IsActive() && bpmem.tevind[i].bt < bpmem.genMode.numindstages)
usedtextures[bpmem.tevindref.getTexMap(bpmem.tevind[i].bt)] = true;
- TextureCache::UnbindTextures();
+ TextureCacheBase::UnbindTextures();
for (unsigned int i : usedtextures)
{
- const TextureCache::TCacheEntryBase* tentry = TextureCache::Load(i);
+ const TextureCacheBase::TCacheEntryBase* tentry = TextureCacheBase::Load(i);
if (tentry)
{
@@ -226,7 +226,7 @@ void VertexManagerBase::Flush()
ERROR_LOG(VIDEO, "error loading texture");
}
}
- TextureCache::BindTextures();
+ TextureCacheBase::BindTextures();
}
// set global vertex constants