Add various profiler events to analyze models importing workflow

This commit is contained in:
Wojtek Figat
2023-12-03 11:23:45 +01:00
parent 022a69aaf2
commit 1843689a88
8 changed files with 38 additions and 6 deletions

View File

@@ -306,6 +306,8 @@ bool AssetsImportingManager::ImportIfEdited(const StringView& inputPath, const S
bool AssetsImportingManager::Create(const Function<CreateAssetResult(CreateAssetContext&)>& callback, const StringView& inputPath, const StringView& outputPath, Guid& assetId, void* arg)
{
PROFILE_CPU();
ZoneText(*outputPath, outputPath.Length());
const auto startTime = Platform::GetTimeSeconds();
// Pick ID if not specified
@@ -369,7 +371,7 @@ bool AssetsImportingManager::Create(const Function<CreateAssetResult(CreateAsset
if (result == CreateAssetResult::Ok)
{
// Register asset
Content::GetRegistry()->RegisterAsset(context.Data.Header, outputPath);
Content::GetRegistry()->RegisterAsset(context.Data.Header, context.TargetAssetPath);
// Done
const auto endTime = Platform::GetTimeSeconds();

View File

@@ -17,6 +17,7 @@
#include "Engine/Content/Content.h"
#include "Engine/Platform/FileSystem.h"
#include "Engine/Utilities/RectPack.h"
#include "Engine/Profiler/ProfilerCPU.h"
#include "AssetsImportingManager.h"
bool ImportModel::TryGetImportOptions(const StringView& path, Options& options)
@@ -437,6 +438,7 @@ CreateAssetResult ImportModel::Create(CreateAssetContext& context)
CreateAssetResult ImportModel::CreateModel(CreateAssetContext& context, ModelData& modelData, const Options* options)
{
PROFILE_CPU();
IMPORT_SETUP(Model, Model::SerializedVersion);
// Save model header
@@ -487,6 +489,7 @@ CreateAssetResult ImportModel::CreateModel(CreateAssetContext& context, ModelDat
CreateAssetResult ImportModel::CreateSkinnedModel(CreateAssetContext& context, ModelData& modelData, const Options* options)
{
PROFILE_CPU();
IMPORT_SETUP(SkinnedModel, SkinnedModel::SerializedVersion);
// Save skinned model header
@@ -528,6 +531,7 @@ CreateAssetResult ImportModel::CreateSkinnedModel(CreateAssetContext& context, M
CreateAssetResult ImportModel::CreateAnimation(CreateAssetContext& context, ModelData& modelData, const Options* options)
{
PROFILE_CPU();
IMPORT_SETUP(Animation, Animation::SerializedVersion);
// Save animation data