From 2cdc93f4ab690279df064832d4c9688741556f0c Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sat, 22 Apr 2017 23:44:34 -0500 Subject: Video Backends: Split texture cache code out into separate files, introduce 'AbstractTexture' --- Source/Core/VideoBackends/Software/SWmain.cpp | 35 +++++++-------------------- 1 file changed, 9 insertions(+), 26 deletions(-) (limited to 'Source/Core/VideoBackends/Software/SWmain.cpp') diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp index e004a0cac3..5319ccecd6 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -15,6 +15,7 @@ #include "VideoBackends/Software/Rasterizer.h" #include "VideoBackends/Software/SWOGLWindow.h" #include "VideoBackends/Software/SWRenderer.h" +#include "VideoBackends/Software/SWTexture.h" #include "VideoBackends/Software/SWVertexLoader.h" #include "VideoBackends/Software/VideoBackend.h" @@ -49,7 +50,7 @@ class TextureCache : public TextureCacheBase public: bool CompileShaders() override { return true; } void DeleteShaders() override {} - void ConvertTexture(TCacheEntryBase* entry, TCacheEntryBase* unconverted, void* palette, + void ConvertTexture(TCacheEntry* entry, TCacheEntry* unconverted, void* palette, TlutFormat format) override { } @@ -61,33 +62,15 @@ public: } private: - struct TCacheEntry : TCacheEntryBase + std::unique_ptr CreateTexture(const TextureConfig& config) override { - TCacheEntry(const TCacheEntryConfig& _config) : TCacheEntryBase(_config) {} - ~TCacheEntry() {} - void Load(u32 level, u32 width, u32 height, u32 row_length, const u8* buffer, - size_t buffer_size) override - { - } - void FromRenderTarget(bool is_depth_copy, const EFBRectangle& srcRect, bool scaleByHalf, - unsigned int cbufid, const float* colmat) override - { - EfbCopy::CopyEfb(); - } - - void CopyRectangleFromTexture(const TCacheEntryBase* source, - const MathUtil::Rectangle& srcrect, - const MathUtil::Rectangle& dstrect) override - { - } - - void Bind(unsigned int stage) override {} - bool Save(const std::string& filename, unsigned int level) override { return false; } - }; - - TCacheEntryBase* CreateTexture(const TCacheEntryConfig& config) override + return std::make_unique(config); + } + + void CopyEFBToCacheEntry(TCacheEntry* entry, bool is_depth_copy, const EFBRectangle& src_rect, + bool scale_by_half, unsigned int cbuf_id, const float* colmat) override { - return new TCacheEntry(config); + EfbCopy::CopyEfb(); } }; -- cgit v1.2.3