summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Assets/CustomAsset.cpp
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2025-05-04 12:14:18 -0500
committeriwubcode <iwubcode@users.noreply.github.com>2025-06-06 23:03:02 -0500
commit316740daede362a144b1a3756cf747e988ead0ab (patch)
tree8c4b0f6342eaf20f7afbc03f5bc8e81489ad4367 /Source/Core/VideoCommon/Assets/CustomAsset.cpp
parent9ec69b5925ea4230077e7f77795b7a0f7a05e963 (diff)
VideoCommon: add 'Unload' functionality to CustomAsset
Diffstat (limited to 'Source/Core/VideoCommon/Assets/CustomAsset.cpp')
-rw-r--r--Source/Core/VideoCommon/Assets/CustomAsset.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/Assets/CustomAsset.cpp b/Source/Core/VideoCommon/Assets/CustomAsset.cpp
index c06b184b7f..5a9155d829 100644
--- a/Source/Core/VideoCommon/Assets/CustomAsset.cpp
+++ b/Source/Core/VideoCommon/Assets/CustomAsset.cpp
@@ -23,6 +23,18 @@ bool CustomAsset::Load()
return load_information.m_bytes_loaded != 0;
}
+std::size_t CustomAsset::Unload()
+{
+ UnloadImpl();
+ std::size_t bytes_loaded = 0;
+ {
+ std::lock_guard lk(m_info_lock);
+ bytes_loaded = m_bytes_loaded;
+ m_bytes_loaded = 0;
+ }
+ return bytes_loaded;
+}
+
CustomAssetLibrary::TimeType CustomAsset::GetLastWriteTime() const
{
return m_owning_library->GetLastAssetWriteTime(m_asset_id);