Merge pull request #4224 from lioncash/tcache

TextureCacheBase: Eliminate static state
This commit is contained in:
Mat M
2016-12-23 04:33:42 -05:00
committed by GitHub
21 changed files with 141 additions and 163 deletions

View File

@ -841,11 +841,11 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight,
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(fbStride, fbHeight);

View File

@ -127,12 +127,11 @@ 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(texture->GetTex(), TextureCache::temp, width, height, src_pitch, level,
usage);
D3D::ReplaceRGBATexture2D(texture->GetTex(), buffer, width, height, src_pitch, level, usage);
}
TextureCacheBase::TCacheEntryBase* TextureCache::CreateTexture(const TCacheEntryConfig& config)

View File

@ -32,8 +32,7 @@ private:
const MathUtil::Rectangle<int>& srcrect,
const MathUtil::Rectangle<int>& dstrect) 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 srcFormat, const EFBRectangle& srcRect,
bool scaleByHalf, unsigned int cbufid, const float* colmat) override;