Add more logging for cooking process
This commit is contained in:
@@ -362,7 +362,7 @@ bool CookAssetsStep::ProcessDefaultAsset(AssetCookData& options)
|
|||||||
|
|
||||||
bool CookAssetsStep::Process(CookingData& data, CacheData& cache, Asset* asset)
|
bool CookAssetsStep::Process(CookingData& data, CacheData& cache, Asset* asset)
|
||||||
{
|
{
|
||||||
// Validate asset
|
PROFILE_CPU_ASSET(asset);
|
||||||
if (asset->IsVirtual())
|
if (asset->IsVirtual())
|
||||||
{
|
{
|
||||||
// Virtual assets are not included into the build
|
// Virtual assets are not included into the build
|
||||||
@@ -790,7 +790,10 @@ bool CookAssetsStep::Process(CookingData& data, CacheData& cache, BinaryAsset* a
|
|||||||
// Prepare asset data
|
// Prepare asset data
|
||||||
AssetInitData initData;
|
AssetInitData initData;
|
||||||
if (asset->Storage->LoadAssetHeader(asset->GetID(), initData))
|
if (asset->Storage->LoadAssetHeader(asset->GetID(), initData))
|
||||||
|
{
|
||||||
|
LOG(Warning, "Failed to load asset {} header from storage '{}'", asset->GetID(), asset->Storage->GetPath());
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
initData.Header.UnlinkChunks();
|
initData.Header.UnlinkChunks();
|
||||||
initData.Metadata.Release();
|
initData.Metadata.Release();
|
||||||
for (auto& e : initData.Dependencies)
|
for (auto& e : initData.Dependencies)
|
||||||
@@ -1162,7 +1165,7 @@ bool CookAssetsStep::Perform(CookingData& data)
|
|||||||
assetRef = Content::LoadAsync<Asset>(assetId);
|
assetRef = Content::LoadAsync<Asset>(assetId);
|
||||||
if (assetRef == nullptr)
|
if (assetRef == nullptr)
|
||||||
{
|
{
|
||||||
data.Error(TEXT("Failed to load asset included in build."));
|
LOG(Error, "Failed to load asset {} included in build", assetId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
e.Info.TypeName = assetRef->GetTypeName();
|
e.Info.TypeName = assetRef->GetTypeName();
|
||||||
@@ -1170,6 +1173,7 @@ bool CookAssetsStep::Perform(CookingData& data)
|
|||||||
// Cook asset
|
// Cook asset
|
||||||
if (Process(data, cache, assetRef.Get()))
|
if (Process(data, cache, assetRef.Get()))
|
||||||
{
|
{
|
||||||
|
LOG(Error, "Failed to process asset {}", assetRef->ToString());
|
||||||
cache.Save(data);
|
cache.Save(data);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1202,10 +1206,17 @@ bool CookAssetsStep::Perform(CookingData& data)
|
|||||||
// Copy file
|
// Copy file
|
||||||
if (!FileSystem::FileExists(cookedPath) || FileSystem::GetFileLastEditTime(cookedPath) >= FileSystem::GetFileLastEditTime(filePath))
|
if (!FileSystem::FileExists(cookedPath) || FileSystem::GetFileLastEditTime(cookedPath) >= FileSystem::GetFileLastEditTime(filePath))
|
||||||
{
|
{
|
||||||
if (FileSystem::CreateDirectory(StringUtils::GetDirectoryName(cookedPath)))
|
const String cookedFolder = StringUtils::GetDirectoryName(cookedPath);
|
||||||
|
if (FileSystem::CreateDirectory(cookedFolder))
|
||||||
|
{
|
||||||
|
LOG(Error, "Failed to create directory '{}'", cookedFolder);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
if (FileSystem::CopyFile(cookedPath, filePath))
|
if (FileSystem::CopyFile(cookedPath, filePath))
|
||||||
|
{
|
||||||
|
LOG(Error, "Failed to copy file from '{}' to '{}'", filePath, cookedPath);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Count stats of file extension
|
// Count stats of file extension
|
||||||
|
|||||||
@@ -314,6 +314,8 @@ bool BinaryAsset::SaveAsset(const StringView& path, AssetInitData& data, bool si
|
|||||||
|
|
||||||
bool BinaryAsset::SaveToAsset(const StringView& path, AssetInitData& data, bool silentMode)
|
bool BinaryAsset::SaveToAsset(const StringView& path, AssetInitData& data, bool silentMode)
|
||||||
{
|
{
|
||||||
|
PROFILE_CPU();
|
||||||
|
|
||||||
// Ensure path is in a valid format
|
// Ensure path is in a valid format
|
||||||
String pathNorm(path);
|
String pathNorm(path);
|
||||||
ContentStorageManager::FormatPath(pathNorm);
|
ContentStorageManager::FormatPath(pathNorm);
|
||||||
|
|||||||
@@ -1090,7 +1090,7 @@ bool FlaxStorage::LoadAssetHeader(const Entry& e, AssetInitData& data)
|
|||||||
stream->ReadInt32(&chunkIndex);
|
stream->ReadInt32(&chunkIndex);
|
||||||
if (chunkIndex < -1 || chunkIndex >= _chunks.Count())
|
if (chunkIndex < -1 || chunkIndex >= _chunks.Count())
|
||||||
{
|
{
|
||||||
LOG(Warning, "Invalid chunks mapping.");
|
LOG(Warning, "Invalid chunks mapping ({} -> {}).", i, chunkIndex);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
data.Header.Chunks[i] = chunkIndex == INVALID_INDEX ? nullptr : _chunks[chunkIndex];
|
data.Header.Chunks[i] = chunkIndex == INVALID_INDEX ? nullptr : _chunks[chunkIndex];
|
||||||
@@ -1147,7 +1147,7 @@ bool FlaxStorage::LoadAssetHeader(const Entry& e, AssetInitData& data)
|
|||||||
stream->ReadInt32(&chunkIndex);
|
stream->ReadInt32(&chunkIndex);
|
||||||
if (chunkIndex < -1 || chunkIndex >= _chunks.Count())
|
if (chunkIndex < -1 || chunkIndex >= _chunks.Count())
|
||||||
{
|
{
|
||||||
LOG(Warning, "Invalid chunks mapping.");
|
LOG(Warning, "Invalid chunks mapping ({} -> {}).", i, chunkIndex);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
data.Header.Chunks[i] = chunkIndex == INVALID_INDEX ? nullptr : _chunks[chunkIndex];
|
data.Header.Chunks[i] = chunkIndex == INVALID_INDEX ? nullptr : _chunks[chunkIndex];
|
||||||
@@ -1202,7 +1202,7 @@ bool FlaxStorage::LoadAssetHeader(const Entry& e, AssetInitData& data)
|
|||||||
stream->ReadInt32(&chunkIndex);
|
stream->ReadInt32(&chunkIndex);
|
||||||
if (chunkIndex < -1 || chunkIndex >= _chunks.Count())
|
if (chunkIndex < -1 || chunkIndex >= _chunks.Count())
|
||||||
{
|
{
|
||||||
LOG(Warning, "Invalid chunks mapping.");
|
LOG(Warning, "Invalid chunks mapping ({} -> {}).", i, chunkIndex);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
data.Header.Chunks[i] = chunkIndex == INVALID_INDEX ? nullptr : _chunks[chunkIndex];
|
data.Header.Chunks[i] = chunkIndex == INVALID_INDEX ? nullptr : _chunks[chunkIndex];
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "Engine/Content/Deprecated.h"
|
#include "Engine/Content/Deprecated.h"
|
||||||
#include "Engine/Serialization/MemoryReadStream.h"
|
#include "Engine/Serialization/MemoryReadStream.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "Engine/Profiler/ProfilerCPU.h"
|
||||||
#include "Engine/ShadowsOfMordor/AtlasChartsPacker.h"
|
#include "Engine/ShadowsOfMordor/AtlasChartsPacker.h"
|
||||||
|
|
||||||
ShaderStorage::CachingMode ShaderStorage::CurrentCachingMode =
|
ShaderStorage::CachingMode ShaderStorage::CurrentCachingMode =
|
||||||
@@ -157,7 +158,7 @@ bool IsValidShaderCache(DataContainer<byte>& shaderCache, Array<String>& include
|
|||||||
|
|
||||||
bool ShaderAssetBase::LoadShaderCache(ShaderCacheResult& result)
|
bool ShaderAssetBase::LoadShaderCache(ShaderCacheResult& result)
|
||||||
{
|
{
|
||||||
// Prepare
|
PROFILE_CPU();
|
||||||
auto parent = GetShaderAsset();
|
auto parent = GetShaderAsset();
|
||||||
const ShaderProfile shaderProfile = GPUDevice::Instance->GetShaderProfile();
|
const ShaderProfile shaderProfile = GPUDevice::Instance->GetShaderProfile();
|
||||||
const int32 cacheChunkIndex = GetCacheChunkIndex(shaderProfile);
|
const int32 cacheChunkIndex = GetCacheChunkIndex(shaderProfile);
|
||||||
|
|||||||
Reference in New Issue
Block a user