6#include "Containers/Array.h"
10#include "Containers/Map.h"
23#include "Misc/Optional.h"
91#define CHECK_IS_LOCKED_CURRENT_THREAD(CritSec) check(CritSec.IsLockedOnCurrentThread())
92#define CHECK_IS_NOT_LOCKED_CURRENT_THREAD(CritSec) check(!CritSec.IsLockedOnCurrentThread())
96#define CHECK_IS_LOCKED_CURRENT_THREAD(CritSec) do {} while (false)
97#define CHECK_IS_NOT_LOCKED_CURRENT_THREAD(CritSec) do {} while (false)
195 virtual bool Init()
override;
197 virtual void Stop()
override;
198 virtual void Exit()
override;
315 void PauseProcessing() { IsProcessingPaused.fetch_add(1, std::memory_order_relaxed); }
328 enum class ETickResult
344 ETickResult TickInternal(
double& TickStartTime,
bool bPollDiscovery);
355 void IngestDiscoveryResults();
428 void SetIsIdle(
bool IsIdle);
429 void SetIsIdle(
bool IsIdle,
double& TickStartTime);
435 struct FScopedGatheringPause
438 ~FScopedGatheringPause();
443 static FString NormalizeLocalPath(
FStringView LocalPath);
479 bool bGatherAssetPackageData;
481 bool bGatherDependsData;
489 std::atomic<uint32> IsStopped;
491 mutable std::atomic<uint32> IsGatheringPaused;
494 mutable std::atomic<uint32> IsProcessingPaused;
502 std::atomic<bool> bSaveAsyncCacheTriggered;
504 std::atomic<bool> bCacheReadEnabled;
506 std::atomic<bool> bCacheWriteEnabled;
534 float CumulativeGatherTime = 0.f;
540 double CurrentSearchTime = 0.;
542 double LastCacheWriteTime;
544 int32 NumPathsToSearchAtLastSyncPoint;
546 int32 NumCachedAssetFiles = 0;
548 int32 NumUncachedAssetFiles = 0;
550 int32 NumUncachedAssetFilesOutstanding = 0;
552 bool bHasLoadedCache;
554 bool bDiscoveryIsComplete;
558 bool bRequestAssetRegistryTick;
562 bool bFirstTickAfterIdle;
564 bool bFinishedInitialDiscovery;
566 std::atomic<bool> bIsInitialSearchCompleted;
568 std::atomic<bool> bIsAdditionalMountSearchInProgress;
569 std::atomic<bool> bGatherOnGameThreadOnly;
587 int32 LastCacheSaveNumUncachedAssetFiles;
592 int32 CacheInUseCount;
597 bool bSynchronousTick;
599 bool bIsSavingAsyncCache;
601 bool bFlushedRetryFiles;
615 bSaveAsyncCacheTriggered =
true;
620 return GatheredResultsEvent;
625 bGatherOnGameThreadOnly.store(bValue, std::memory_order_relaxed);
630 return bGatherOnGameThreadOnly.load(std::memory_order_relaxed);
635 bIsAdditionalMountSearchInProgress.store(
bIsInProgress, std::memory_order_relaxed);
FCriticalSection FGathererCriticalSection
Definition AssetDataGatherer.h:94
FScopeLock FGathererScopeLock
Definition AssetDataGatherer.h:95
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
#define DECLARE_TS_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:50
Definition AssetRegistry.Build.cs:6
Definition Archive.h:1208
Definition AssetDataGatherer.h:175
void RequestAsyncCacheSave()
Definition AssetDataGatherer.h:613
void GetPackageResults(UE::AssetDataGather::FResults &InOutResults)
Definition AssetDataGatherer.cpp:4822
static bool ReadAssetFile(FPackageReader &PackageReader, TArray< FAssetData * > &AssetDataList, FPackageDependencyData &DependencyData, TArray< FString > &CookedPackagesToLoadUponDiscovery, FPackageReader::EReadOptions Options)
Definition AssetDataGatherer.cpp:4698
void PrioritizeSearchPath(const FString &PathToPrioritize)
Definition AssetDataGatherer.cpp:5676
bool IsOnDenyList(FStringView LocalPath) const
Definition AssetDataGatherer.cpp:5746
SIZE_T GetAllocatedSize() const
Definition AssetDataGatherer.cpp:5534
void OnAdditionalMountSearchCompleted()
Definition AssetDataGatherer.cpp:3912
virtual uint32 Run() override
Definition AssetDataGatherer.cpp:3940
void OnDirectoryCreated(FStringView LocalPath)
Definition AssetDataGatherer.cpp:5652
void SetInitialPluginsLoaded()
Definition AssetDataGatherer.cpp:5053
void OnFilesCreated(TConstArrayView< FString > LocalPaths)
Definition AssetDataGatherer.cpp:5661
void ClearCache()
Definition AssetDataGatherer.cpp:4866
void ResumeProcessing()
Definition AssetDataGatherer.h:316
bool IsMonitored(FStringView LocalPath) const
Definition AssetDataGatherer.cpp:5751
virtual ~FAssetDataGatherer()
Definition AssetDataGatherer.cpp:3844
void EnsureCompletion()
Definition AssetDataGatherer.cpp:4230
FGatheredResultsEvent & GetGatheredResultsEvent()
Definition AssetDataGatherer.h:618
void OnInitialSearchCompleted()
Definition AssetDataGatherer.cpp:3900
virtual void Stop() override
Definition AssetDataGatherer.cpp:4210
void PauseProcessing()
Definition AssetDataGatherer.h:315
bool IsComplete() const
Definition AssetDataGatherer.cpp:5040
void SetIsOnAllowList(FStringView LocalPath, bool bIsAllowed)
Definition AssetDataGatherer.cpp:5732
void SetIsAdditionalMountSearchInProgress(bool bIsInProgress)
Definition AssetDataGatherer.h:633
bool IsGatheringDependencies() const
Definition AssetDataGatherer.cpp:5059
virtual void Exit() override
Definition AssetDataGatherer.cpp:4216
bool IsCacheReadEnabled() const
Definition AssetDataGatherer.cpp:5064
void AddRequiredMountPoints(TArrayView< FString > LocalPaths)
Definition AssetDataGatherer.cpp:5629
static TConstArrayView< const TCHAR * > GetVerseFileExtensions()
Definition AssetDataGatherer.cpp:5771
bool IsProcessingPauseRequested() const
Definition AssetDataGatherer.h:317
bool IsOnAllowList(FStringView LocalPath) const
Definition AssetDataGatherer.cpp:5741
bool IsAsyncEnabled() const
Definition AssetDataGatherer.cpp:4220
FAssetGatherDiagnostics GetDiagnostics()
Definition AssetDataGatherer.cpp:4810
void GetAndTrimSearchResults(UE::AssetDataGather::FResults &InOutResults, UE::AssetDataGather::FResultContext &OutContext)
Definition AssetDataGatherer.cpp:4762
void WaitForIdle(float TimeoutSeconds=-1.0f)
Definition AssetDataGatherer.cpp:4992
void RemoveMountPoint(FStringView LocalPath)
Definition AssetDataGatherer.cpp:5624
bool IsCacheWriteEnabled() const
Definition AssetDataGatherer.cpp:5069
void AddMountPoint(FStringView LocalPath, FStringView LongPackageName)
Definition AssetDataGatherer.cpp:5612
void StartAsync()
Definition AssetDataGatherer.cpp:3924
void UpdateCacheForSaving()
Definition AssetDataGatherer.cpp:3862
void WaitOnPath(FStringView LocalPath)
Definition AssetDataGatherer.cpp:4850
bool HasSerializedDiscoveryCache() const
Definition AssetDataGatherer.cpp:5046
bool IsGatherOnGameThreadOnly() const
Definition AssetDataGatherer.h:628
bool IsSynchronous() const
Definition AssetDataGatherer.cpp:4225
void ScanPathsSynchronous(const TArray< FString > &InPaths, bool bForceRescan, bool bIgnoreDenyListScanFilters)
Definition AssetDataGatherer.cpp:4912
virtual bool Init() override
Definition AssetDataGatherer.cpp:3935
static bool IsVerseFile(FStringView FilePath)
Definition AssetDataGatherer.cpp:5759
void SetGatherOnGameThreadOnly(bool bValue)
Definition AssetDataGatherer.h:623
Definition AssetRegistryArchive.h:23
Definition CriticalSectionQueryable.h:13
Definition DiskCachedAssetData.h:24
Definition NameTypes.h:617
Definition PackageDependencyData.h:12
Definition PackageReader.h:20
EReadOptions
Definition PackageReader.h:109
Definition RunnableThread.h:20
Definition CriticalSectionQueryable.h:72
Definition ScopeLock.h:141
Definition ArrayView.h:139
UE_NODEBUG UE_FORCEINLINE_HINT SIZE_T GetAllocatedSize(void) const
Definition Array.h:1059
UE_FORCEINLINE_HINT void Shrink()
Definition Array.h:1278
Definition UnrealString.h.inl:34
Definition RingBuffer.h:135
void Trim()
Definition RingBuffer.h:259
SIZE_T GetAllocatedSize(void) const
Definition RingBuffer.h:789
Definition UniquePtr.h:107
Definition AssetRegistry.h:21
@ CaseSensitive
Definition CString.h:23
@ Owner
Definition XmppMultiUserChat.h:25
Definition AssetDataGatherer.cpp:50
TSet< FWaitBatchDirectory, FWaitBatchDirectorySetFuncs > FWaitBatchDirectorySet
Definition AssetDataGatherer.h:83
EPriority
Definition AssetDataGathererPrivate.h:25
Definition AssetDataGatherer.cpp:50
Definition AssetDataGatherer.h:86
EGatherStatus
Definition AssetRegistryImpl.h:267
Definition PackageReader.h:15
uint32 GetTypeHash(const FPropertyPathName &Path)
Definition PropertyPathName.cpp:133
Definition SetUtilities.h:23
Definition AssetData.h:162
Definition AssetDataGatherer.h:103
int32 NumCachedDirectories
Definition AssetDataGatherer.h:111
float DiscoveryTimeSeconds
Definition AssetDataGatherer.h:105
float GatherTimeSeconds
Definition AssetDataGatherer.h:107
float WallTimeSeconds
Definition AssetDataGatherer.h:109
int32 NumUncachedAssetFiles
Definition AssetDataGatherer.h:117
int32 NumCachedAssetFiles
Definition AssetDataGatherer.h:115
int32 NumUncachedDirectories
Definition AssetDataGatherer.h:113
Definition Optional.h:131
Definition AssetDataGatherer.h:159
int32 NumFilesToSearch
Definition AssetDataGatherer.h:163
bool bIsDiscoveringFiles
Definition AssetDataGatherer.h:165
TArray< double > SearchTimes
Definition AssetDataGatherer.h:162
int32 NumPathsToSearch
Definition AssetDataGatherer.h:164
bool bIsSearching
Definition AssetDataGatherer.h:160
bool bAbleToProgress
Definition AssetDataGatherer.h:161
Definition AssetDataGatherer.h:125
TMultiMap< FName, TUniquePtr< FAssetData > > Assets
Definition AssetDataGatherer.h:126
TMultiMap< FName, FPackageDependencyData > DependenciesForGameThread
Definition AssetDataGatherer.h:130
TMultiMap< FName, FPackageDependencyData > Dependencies
Definition AssetDataGatherer.h:129
TRingBuffer< FName > VerseFiles
Definition AssetDataGatherer.h:132
TRingBuffer< FString > CookedPackageNamesWithoutAssetData
Definition AssetDataGatherer.h:131
TArray< FString > BlockedFiles
Definition AssetDataGatherer.h:133
void Shrink()
Definition AssetDataGatherer.h:141
SIZE_T GetAllocatedSize() const
Definition AssetDataGatherer.h:135
TMultiMap< FName, TUniquePtr< FAssetData > > AssetsForGameThread
Definition AssetDataGatherer.h:127
TRingBuffer< FString > Paths
Definition AssetDataGatherer.h:128
Definition AssetDataGathererPrivate.h:39
Definition AssetDataGatherer.h:68
static FORCEINLINE uint32 GetKeyHash(const FString &Key)
Definition AssetDataGatherer.h:77
static FORCEINLINE const FString & GetSetKey(const FWaitBatchDirectory &Element)
Definition AssetDataGatherer.h:69
static FORCEINLINE bool Matches(const FString &A, const FString &B)
Definition AssetDataGatherer.h:73
Definition AssetDataGatherer.h:51
FString Path
Definition AssetDataGatherer.h:63
friend int32 GetTypeHash(const FWaitBatchDirectory &WaitBatchDirectory)
Definition AssetDataGatherer.h:58
FWaitBatchDirectory(const FStringView InPath, const bool InIsRecursive)
Definition AssetDataGatherer.h:52
bool bIsRecursive
Definition AssetDataGatherer.h:64