![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include "Serialization/AsyncPackageLoader.h"#include "HAL/IConsoleManager.h"#include "Serialization/AsyncLoadingThread.h"#include "Serialization/AsyncLoading2.h"#include "Serialization/TransactionallySafeAsyncLoading.h"#include "UObject/GCObject.h"#include "UObject/LinkerLoad.h"#include "IO/PackageId.h"#include "Misc/CoreDelegates.h"#include "Misc/PackageName.h"#include "Misc/PathViews.h"#include "IO/IoDispatcher.h"#include "IO/IoDispatcherInternal.h"#include "AutoRTFM.h"#include "Containers/StackTracker.h"#include "Misc/OutputDeviceFile.h"#include "ProfilingDebugging/CsvProfiler.h"Classes | |
| class | FEarlyRegistrationEventsRecorder |
| struct | FTrackAsyncLoadRequests |
| struct | FTrackAsyncLoadRequests::FUserData |
| struct | FTrackAsyncLoadRequests::FUserData::FLoadRequest |
Macros | |
| #define | DO_TRACK_ASYNC_LOAD_REQUESTS (!UE_BUILD_SHIPPING && !UE_BUILD_TEST) |
Variables | |
| volatile int32 | GIsLoaderCreated |
| TUniquePtr< IAsyncPackageLoader > | GPackageLoader |
| bool | GAsyncLoadingAllowed = true |
| bool | GIoDispatcherInitializedByLoader = false |
| const FName | PrestreamPackageClassNameLoad = FName("PrestreamPackage") |
| double | GFlushAsyncLoadingTime = 0.0 |
| uint32 | GFlushAsyncLoadingCount = 0 |
| uint32 | GSyncLoadCount = 0 |
| int32 | GWarnIfTimeLimitExceeded = 0 |
| float | GTimeLimitExceededMultiplier = 1.5f |
| float | GTimeLimitExceededMinTime = 0.005f |
| #define DO_TRACK_ASYNC_LOAD_REQUESTS (!UE_BUILD_SHIPPING && !UE_BUILD_TEST) |
| void CancelAsyncLoading | ( | ) |
Cancels all async package loading requests.
Checks if the object can have PostLoad called on the Async Loading Thread
| void FlushAsyncLoading | ( | int32 | PackageID = INDEX_NONE | ) |
Blocks till all pending package/ linker requests are fulfilled.
| PackageID | if the package associated with this request ID gets loaded, FlushAsyncLoading returns immediately without waiting for the remaining packages to finish loading. |
| void FlushAsyncLoading | ( | TConstArrayView< int32 > | RequestIds | ) |
Blocks till a set of pending async load requests are complete.
| RequestIds | list of return values from LoadPackageAsync to wait for. An empty list means all requests |
Returns the async load percentage for a package in flight with the passed in name or -1 if there isn't one.
| PackageName | Name of package to query load percentage for |
| IAsyncPackageLoader & GetAsyncPackageLoader | ( | ) |
| ELoaderType GetLoaderTypeInternal | ( | ) |
| int32 GetNumAsyncPackages | ( | ) |
Return number of active async load package requests
| void InitAsyncThread | ( | ) |
ThreadIndex =
| bool IsAsyncLoadingCoreUObjectInternal | ( | ) |
| bool IsAsyncLoadingMultithreadedCoreUObjectInternal | ( | ) |
| bool IsAsyncLoadingSuspendedInternal | ( | ) |
| bool IsInAsyncLoadingThreadCoreUObjectInternal | ( | ) |
| void IsTimeLimitExceededPrint | ( | double | InTickStartTime, |
| double | CurrentTime, | ||
| double | LastTestTime, | ||
| double | InTimeLimit, | ||
| const TCHAR * | InLastTypeOfWorkPerformed, | ||
| UObject * | InLastObjectWorkWasPerformedOn | ||
| ) |
| int32 LoadPackageAsync | ( | const FPackagePath & | InPackagePath, |
| FLoadPackageAsyncOptionalParams | InOptionalParams | ||
| ) |
Asynchronously load a package and all contained objects that match context flags. Non-blocking. Use this version to specify the PackagePath rather than having the other versions internally convert the InName to a PackagePath by searching the current package mount points. Use this version if you need to specify a packagename that is different from the packagename on disk; this is useful when loading multiple copies of the same package.
| InPackagePath | PackagePath to load. Must be a mounted path. The package is created if it does not already exist. |
| InOptionalParams | Optional parameters. |
| int32 LoadPackageAsync | ( | const FPackagePath & | InPackagePath, |
| FName | InPackageNameToCreate = NAME_None, |
||
| FLoadPackageAsyncDelegate | InCompletionDelegate = FLoadPackageAsyncDelegate(), |
||
| EPackageFlags | InPackageFlags = PKG_None, |
||
| int32 | InPIEInstanceID = INDEX_NONE, |
||
| TAsyncLoadPriority | InPackagePriority = 0, |
||
| const FLinkerInstancingContext * | InstancingContext = nullptr, |
||
| uint32 | LoadFlags = LOAD_None |
||
| ) |
Asynchronously load a package and all contained objects that match context flags. Non-blocking. Use this version to specify the PackagePath rather than having the other versions internally convert the InName to a PackagePath by searching the current package mount points. Use this version if you need to specify a packagename that is different from the packagename on disk; this is useful when loading multiple copies of the same package.
| InPackagePath | PackagePath to load. Must be a mounted path. The package is created if it does not already exist. |
| InPackageNameToCreate | If not none, this is the name of the package to load the bytes on disk into (and create if not yet existing). If none, the name is taken from PackagePath. |
| InCompletionDelegate | Delegate to be invoked when the packages has finished streaming |
| InPackageFlags | Package flags used to construct loaded package in memory |
| InPIEInstanceID | Play in Editor instance ID |
| InPackagePriority | Loading priority |
| InstancingContext | Additional context to map object names to their instanced counterpart when loading an instanced package |
| LoadFlags | Flags controlling loading behavior, from the ELoadFlags enum |
Asynchronously load a package and all contained objects that match context flags. Non-blocking. Use this version for convenience when you just need to load a package without notification and with default behavior from a packagename/filename.
| InName | PackageName or LocalFilePath of package to load. Must be a mounted name/path. The package is created if it does not already exist. |
| InGuid | GUID of the package to load, or nullptr for "don't care" |
| int32 LoadPackageAsync | ( | const FString & | InName, |
| const FGuid * | InGuid, | ||
| const TCHAR * | InPackageToLoadFrom, | ||
| FLoadPackageAsyncDelegate | InCompletionDelegate, | ||
| EPackageFlags | InPackageFlags, | ||
| int32 | InPIEInstanceID, | ||
| int32 | InPackagePriority, | ||
| const FLinkerInstancingContext * | InstancingContext | ||
| ) |
| int32 LoadPackageAsync | ( | const FString & | InName, |
| FLoadPackageAsyncDelegate | InCompletionDelegate, | ||
| TAsyncLoadPriority | InPackagePriority = 0, |
||
| EPackageFlags | InPackageFlags = PKG_None, |
||
| int32 | InPIEInstanceID = INDEX_NONE |
||
| ) |
Asynchronously load a package and all contained objects that match context flags. Non-blocking. Use this version when you need to load a package with default behavior from a packagename/filename, and need to be notified when it is loaded.
| InName | PackageName or LocalFilePath of package to load. Must be a mounted name/path. The package is created if it does not already exist. |
| InCompletionDelegate | Delegate to be invoked when the packages has finished streaming |
| InPackagePriority | Loading priority |
| InPackageFlags | Package flags used to construct loaded package in memory |
| InPIEInstanceID | Play in Editor instance ID |
| int32 LoadPackageAsync | ( | const FString & | InName, |
| FLoadPackageAsyncOptionalParams | InOptionalParams | ||
| ) |
Asynchronously load a package and all contained objects that match context flags. Non-blocking. Use this version when you need to load a package with default behavior from a packagename/filename, and need to be notified when it is loaded.
| InName | PackageName or LocalFilePath of package to load. Must be a mounted name/path. The package is created if it does not already exist. |
| InOptionalParams | Optional parameters. |
| void NotifyRegistrationComplete | ( | ) |
| void NotifyRegistrationEvent | ( | FName | PackageName, |
| FName | Name, | ||
| ENotifyRegistrationType | NotifyRegistrationType, | ||
| ENotifyRegistrationPhase | NotifyRegistrationPhase, | ||
| UObject *(*)() | InRegister, | ||
| bool | InbDynamic, | ||
| UObject * | FinishedObject | ||
| ) |
| void NotifyScriptVersePackage | ( | Verse::VPackage * | Package | ) |
| void NotifyUnreachableObjects | ( | const TArrayView< FUObjectItem * > & | UnreachableObjects | ) |
Call back into the async loading code to inform of the destruction of serialized objects
| EAsyncPackageState::Type ProcessAsyncLoading | ( | bool | bUseTimeLimit, |
| bool | bUseFullTimeLimit, | ||
| double | TimeLimit | ||
| ) |
Serializes a bit of data each frame with a soft time limit. The function is designed to be able to fully load a package in a single pass given sufficient time.
| bUseTimeLimit | Whether to use a time limit |
| bUseFullTimeLimit | If true, use the entire time limit even if blocked on I/O |
| TimeLimit | Soft limit of time this function is allowed to consume |
| EAsyncPackageState::Type ProcessAsyncLoadingUntilComplete | ( | TFunctionRef< bool()> | CompletionPredicate, |
| double | TimeLimit | ||
| ) |
Blocks and runs ProcessAsyncLoading until the time limit is hit, the completion predicate returns true, or all async loading is done
| CompletionPredicate | If this returns true, stop loading. This is called periodically as long as loading continues |
| TimeLimit | Hard time limit. 0 means infinite length |
| void ResetAsyncLoadingStats | ( | ) |
| void ResumeAsyncLoadingInternal | ( | ) |
Allows or disallows async loading (for example async loading is not allowed after the final flush on exit)
| bAllowAsyncLoading | true if async loading should be allowed, false otherwise |
| bool ShouldAlwaysLoadPackageAsync | ( | const FPackagePath & | InPackagePath | ) |
| void ShutdownAsyncThread | ( | ) |
| void SuspendAsyncLoadingInternal | ( | ) |
| uint32 GFlushAsyncLoadingCount = 0 |
| double GFlushAsyncLoadingTime = 0.0 |
| TUniquePtr<IAsyncPackageLoader> GPackageLoader |
| uint32 GSyncLoadCount = 0 |
| float GTimeLimitExceededMinTime = 0.005f |
| float GTimeLimitExceededMultiplier = 1.5f |
| int32 GWarnIfTimeLimitExceeded = 0 |