summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2023-06-08 19:48:45 -0500
committeriwubcode <iwubcode@users.noreply.github.com>2023-06-08 19:48:45 -0500
commit429b2eca8a90f895516203d35b5f9b69f1217151 (patch)
tree6147f43e1d3ef575deb1f963d536a06b667af9ee /Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp
parent7845fb00ee1a57b7dd47e2c403345c9329855e27 (diff)
VideoCommon: add logging for loading texture assets
Diffstat (limited to 'Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp')
-rw-r--r--Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp b/Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp
index 68d63a2466..bbb3a644f5 100644
--- a/Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp
+++ b/Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp
@@ -52,7 +52,11 @@ CustomAssetLibrary::LoadInfo DirectFilesystemAssetLibrary::LoadTexture(const Ass
// Raw texture is expected to have one asset mapped
if (asset_map.empty() || asset_map.size() > 1)
+ {
+ ERROR_LOG_FMT(VIDEO, "Asset '{}' error - raw texture expected to have one file mapped!",
+ asset_id);
return {};
+ }
const auto& asset_path = asset_map.begin()->second;
const auto last_loaded_time = std::filesystem::last_write_time(asset_path);
@@ -60,9 +64,12 @@ CustomAssetLibrary::LoadInfo DirectFilesystemAssetLibrary::LoadTexture(const Ass
Common::ToLower(&ext);
if (ext == ".dds")
{
- LoadDDSTexture(data, asset_path.string());
- if (data->m_levels.empty()) [[unlikely]]
+ if (!LoadDDSTexture(data, asset_path.string()))
+ {
+ ERROR_LOG_FMT(VIDEO, "Asset '{}' error - could not load dds texture!", asset_id);
return {};
+ }
+
if (!LoadMips(asset_path, data))
return {};
@@ -75,13 +82,18 @@ CustomAssetLibrary::LoadInfo DirectFilesystemAssetLibrary::LoadTexture(const Ass
data->m_levels.push_back({});
if (!LoadPNGTexture(&data->m_levels[0], asset_path.string()))
+ {
+ ERROR_LOG_FMT(VIDEO, "Asset '{}' error - could not load png texture!", asset_id);
return {};
+ }
+
if (!LoadMips(asset_path, data))
return {};
return LoadInfo{GetAssetSize(*data), last_loaded_time};
}
+ ERROR_LOG_FMT(VIDEO, "Asset '{}' error - extension '{}' unknown!", asset_id, ext);
return {};
}