TextureCacheBase: Eliminate static state

This commit is contained in:
Lioncash
2016-09-06 18:57:58 -04:00
parent 1fa61af413
commit 58a5395173
21 changed files with 141 additions and 163 deletions

View File

@ -794,11 +794,11 @@ void Renderer::SwapImpl(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height
OSD::DrawMessages();
D3D::EndFrame();
TextureCacheBase::Cleanup(frameCount);
g_texture_cache->Cleanup(frameCount);
// Enable configuration changes
UpdateActiveConfig();
TextureCacheBase::OnConfigChanged(g_ActiveConfig);
g_texture_cache->OnConfigChanged(g_ActiveConfig);
SetWindowSize(fb_stride, fb_height);

View File

@ -172,12 +172,12 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture(const TCacheEntryBase*
g_renderer->RestoreAPIState();
}
void TextureCache::TCacheEntry::Load(unsigned int width, unsigned int height,
unsigned int expanded_width, unsigned int level)
void TextureCache::TCacheEntry::Load(const u8* buffer, u32 width, u32 height, u32 expanded_width,
u32 level)
{
unsigned int src_pitch = 4 * expanded_width;
D3D::ReplaceRGBATexture2D(m_texture->GetTex12(), TextureCache::temp, width, height, src_pitch,
level, m_texture->GetResourceUsageState());
D3D::ReplaceRGBATexture2D(m_texture->GetTex12(), buffer, width, height, src_pitch, level,
m_texture->GetResourceUsageState());
}
TextureCacheBase::TCacheEntryBase* TextureCache::CreateTexture(const TCacheEntryConfig& config)

View File

@ -39,8 +39,7 @@ private:
const MathUtil::Rectangle<int>& src_rect,
const MathUtil::Rectangle<int>& dst_rect) override;
void Load(unsigned int width, unsigned int height, unsigned int expanded_width,
unsigned int levels) override;
void Load(const u8* buffer, u32 width, u32 height, u32 expanded_width, u32 levels) override;
void FromRenderTarget(u8* dst, PEControl::PixelFormat src_format, const EFBRectangle& src_rect,
bool scale_by_half, unsigned int cbuf_id, const float* colmat) override;