MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Process

Method Process

Source/Editor/Cooker/Steps/CookAssetsStep.cpp:364–398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364bool CookAssetsStep::Process(CookingData& data, CacheData& cache, Asset* asset)
365{
366 PROFILE_CPU_ASSET(asset);
367 if (asset->IsVirtual())
368 {
369 // Virtual assets are not included into the build
370 return false;
371 }
372 const bool wasLoaded = asset->IsLoaded();
373 if (asset->WaitForLoaded())
374 {
375 LOG(Error, "Failed to load asset \'{0}\'", asset->ToString());
376 return true;
377 }
378 if (!wasLoaded)
379 {
380 // HACK: give some time to resave any old assets in Asset::onLoad after it's loaded
381 // This assumes that if Load Thread enters Asset::Save then it will get asset lock and hold it until asset is saved
382 // So we can take the same lock to wait for save end but first we need to wait for it to get that lock
383 // (in future try to handle it in a better way)
384 Platform::Sleep(5);
385 }
386 ScopeLock lock(asset->Locker);
387
388 // Switch based on an asset type
389 const auto asBinaryAsset = dynamic_cast<BinaryAsset*>(asset);
390 if (asBinaryAsset)
391 return Process(data, cache, asBinaryAsset);
392 const auto asJsonAsset = dynamic_cast<JsonAssetBase*>(asset);
393 if (asJsonAsset)
394 return Process(data, cache, asJsonAsset);
395
396 LOG(Error, "Unknown asset type \'{0}\'", asset->GetTypeName());
397 return false;
398}
399
400bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* assetBase)
401{

Callers 15

UpdateMethod · 0.45
OnKeyDownMethod · 0.45
OnKeyDownMethod · 0.45
OnKeyDownMethod · 0.45
OnKeyDownMethod · 0.45
OnKeyDownMethod · 0.45
OnKeyDownMethod · 0.45
OnKeyDownMethod · 0.45
OnKeyDownMethod · 0.45
OnKeyDownMethod · 0.45
OnKeyDownMethod · 0.45

Calls 15

ToPairFunction · 0.85
IsVirtualMethod · 0.80
WaitForLoadedMethod · 0.80
LoadAssetHeaderMethod · 0.80
GetIDMethod · 0.80
UnlinkChunksMethod · 0.80
LockSafeMethod · 0.80
CreateEntryMethod · 0.80
DeleteChunksMethod · 0.80
CreateFunction · 0.50
IsLoadedMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected