summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Assets/CustomAsset.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/Assets/CustomAsset.cpp')
-rw-r--r--Source/Core/VideoCommon/Assets/CustomAsset.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/Assets/CustomAsset.cpp b/Source/Core/VideoCommon/Assets/CustomAsset.cpp
index 0fc495fe44..60c7f1ee12 100644
--- a/Source/Core/VideoCommon/Assets/CustomAsset.cpp
+++ b/Source/Core/VideoCommon/Assets/CustomAsset.cpp
@@ -13,12 +13,17 @@ CustomAsset::CustomAsset(std::shared_ptr<CustomAssetLibrary> library,
std::size_t CustomAsset::Load()
{
+ // The load time needs to come from before the data is actually read.
+ // Using a time point from after the read marks the asset as more up-to-date than it actually is,
+ // and has potential to race (and not be updated) if a change happens immediately after load.
+ const auto load_time = ClockType::now();
+
const auto load_information = LoadImpl(m_asset_id);
if (load_information.m_bytes_loaded > 0)
{
std::lock_guard lk(m_info_lock);
m_bytes_loaded = load_information.m_bytes_loaded;
- m_last_loaded_time = ClockType::now();
+ m_last_loaded_time = load_time;
return m_bytes_loaded;
}
return 0;