summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.h
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2023-03-21 19:54:50 -0500
committeriwubcode <iwubcode@users.noreply.github.com>2023-06-07 18:30:10 -0500
commitca8d6748d6409943d758b59bf255a161061a648e (patch)
treef5d412c7299c22d628162534f849224681bf1132 /Source/Core/VideoCommon/TextureCacheBase.h
parentf1f1ecc9d116c8295b76d636774f5e922e8941ae (diff)
VideoCommon: introduce linked assets in TCacheEntry, allowing for assets to be reloaded
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.h')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h
index 72151c9443..bcfa7898fd 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.h
+++ b/Source/Core/VideoCommon/TextureCacheBase.h
@@ -4,6 +4,7 @@
#pragma once
#include <array>
+#include <filesystem>
#include <fmt/format.h>
#include <map>
#include <memory>
@@ -35,7 +36,8 @@ struct VideoConfig;
namespace VideoCommon
{
class CustomTextureData;
-}
+class GameTextureAsset;
+} // namespace VideoCommon
constexpr std::string_view EFB_DUMP_PREFIX = "efb1";
constexpr std::string_view XFB_DUMP_PREFIX = "xfb1";
@@ -113,6 +115,12 @@ struct fmt::formatter<EFBCopyParams>
}
};
+struct CachedTextureAsset
+{
+ std::shared_ptr<VideoCommon::GameTextureAsset> m_asset;
+ std::optional<std::filesystem::file_time_type> m_last_write_time;
+};
+
struct TCacheEntry
{
// common members
@@ -164,6 +172,8 @@ struct TCacheEntry
std::string texture_info_name = "";
+ CachedTextureAsset linked_asset;
+
explicit TCacheEntry(std::unique_ptr<AbstractTexture> tex,
std::unique_ptr<AbstractFramebuffer> fb);
@@ -337,6 +347,10 @@ private:
using TexPool = std::unordered_multimap<TextureConfig, TexPoolEntry>;
+ static bool DidLinkedAssetsChange(const TCacheEntry& entry);
+
+ TCacheEntry* LoadImpl(const TextureInfo& texture_info, bool force_reload);
+
bool CreateUtilityTextures();
void SetBackupConfig(const VideoConfig& config);