From e101f7f6aeb941b54bed30af05d6c83bad8ee0aa Mon Sep 17 00:00:00 2001 From: iwubcode Date: Tue, 14 Mar 2023 00:10:40 -0500 Subject: VideoCommon: refactor GetTexture into a separate function for creation, separating the custom texture data path from the game's texture data path --- Source/Core/VideoCommon/TextureCacheBase.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Source/Core/VideoCommon/TextureCacheBase.h') diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h index ce001bb53c..10018732b1 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.h +++ b/Source/Core/VideoCommon/TextureCacheBase.h @@ -32,6 +32,11 @@ class AbstractStagingTexture; class PointerWrap; struct VideoConfig; +namespace VideoCommon +{ +class CustomTextureData; +} + constexpr std::string_view EFB_DUMP_PREFIX = "efb1"; constexpr std::string_view XFB_DUMP_PREFIX = "xfb1"; @@ -242,6 +247,14 @@ public: TexPoolEntry(std::unique_ptr tex, std::unique_ptr fb); }; + struct TextureCreationInfo + { + u64 base_hash; + u64 full_hash; + u32 bytes_per_block; + u32 palette_size; + }; + TextureCacheBase(); virtual ~TextureCacheBase(); @@ -328,6 +341,11 @@ private: void SetBackupConfig(const VideoConfig& config); + RcTcacheEntry CreateTextureEntry(const TextureCreationInfo& creation_info, + const TextureInfo& texture_info, int safety_color_sample_size, + VideoCommon::CustomTextureData* custom_texture_data, + bool custom_arbitrary_mipmaps); + RcTcacheEntry GetXFBFromCache(u32 address, u32 width, u32 height, u32 stride); RcTcacheEntry ApplyPaletteToEntry(RcTcacheEntry& entry, const u8* palette, TLUTFormat tlutfmt); -- cgit v1.2.3