![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <TaskSyncManager.h>
Static Public Member Functions | |
| static ENGINE_API FTaskSyncManager * | Get () |
Global singleton manager that can be used to synchronize tasks across different engine systems. This provides event registration and utility functions that wrap functionality in the base Task and TaskGraph systems.
| FTaskSyncManager::FTaskSyncManager | ( | ) |
| FTaskSyncManager::~FTaskSyncManager | ( | ) |
| FGraphEventRef FTaskSyncManager::CreateManualTickTask | ( | FWorldContextId | WorldContext, |
| FTickFunction * | TickFunction, | ||
| float | DeltaTime = -1.0f, |
||
| ELevelTick | TickType = LEVELTICK_All |
||
| ) |
Creates (but does not dispatch) a simple task that will execute a tick function. The caller is responsible for dispatching the task and must keep the tick function valid until the task completes. This is useful for cases where you want to spawn a tick halfway through a tick group If default delta time is passed, it will try to use the currently ticking world's info
| FBatchContextId FTaskSyncManager::CreateNewBatch | ( | FWorldContextId | WorldContext | ) |
Allocates a new batch for the specified world, this will duplicate the events
Tells the manager that it is the end of a frame and it will not start/end any more tick groups
| void FTaskSyncManager::EndTickGroup | ( | const UWorld * | InWorld, |
| ETickingGroup | TickGroup | ||
| ) |
Tells the manager that a tick group is complete for a specific world, which could trigger events
| FBatchContextId FTaskSyncManager::FindDefaultBatch | ( | FWorldContextId | WorldContext | ) | const |
Gets the default batch for a world context. This will return an invalid id if the world context is not set up for ticking
| FSyncPointId FTaskSyncManager::FindSyncPoint | ( | FBatchContextId | Batch, |
| FName | RegisteredName | ||
| ) |
Initializes a sync point id that can be passed between threads and used in the functions below. This will return an invalid id if the name is not currently registered. This function does not check that the sync point is enabled for the specific batch, that is handled in the other functions below.
| FSyncPointId FTaskSyncManager::FindSyncPoint | ( | FWorldContextId | WorldContext, |
| FName | RegisteredName | ||
| ) |
Same as above, but using the default batch for the world context
|
static |
Return the global singleton if it exists
| FWorldContextId FTaskSyncManager::GetCurrentWorldContext | ( | ) | const |
Gets the correct task world context for the current thread context. This will return an invalid context if called on worker threads
| bool FTaskSyncManager::GetSyncPointDescription | ( | FName | RegisteredName, |
| FSyncPointDescription & | OutDescription | ||
| ) | const |
Searches for a registered sync point, if ones is foundw ith that name it will return true and fill in OutDescription
| FTaskSyncResult FTaskSyncManager::GetTaskGraphEvent | ( | FSyncPointId | SyncPoint, |
| FGraphEventRef & | OutEventRef | ||
| ) |
Attempts to return the current frame's task graph event for this sync point, to pass as a dependency to other tasks. This will fail if the task has not yet been created this frame or it has finished executing.
| FTickFunction * FTaskSyncManager::GetTickFunctionForSyncPoint | ( | FSyncPointId | SyncPoint | ) |
Returns the tick function representing the specified event, if this returns a valid pointer you can use it for setting dependencies but it should not be modified or stored
| bool FTaskSyncManager::RegisterNewSyncPoint | ( | const FSyncPointDescription & | NewDescription | ) |
Registers a new sync point at runtime. RegisteredName and SourceName must be filled out
| FTaskSyncResult FTaskSyncManager::RegisterTickGroupWorkHandle | ( | FWorldContextId | WorldContext, |
| ETickingGroup | TickGroup, | ||
| FActiveSyncWorkHandle & | OutWorkHandle | ||
| ) |
Tries to creates a new sync work handle that can be used to reserve or request work to happen on the game thread during a tick group. If it was successful, OutWorkHandle will be set to a handle you can use to request work for this frame or every frame (but not reserve).
| FTaskSyncResult FTaskSyncManager::RegisterWorkHandle | ( | FSyncPointId | SyncPoint, |
| FActiveSyncWorkHandle & | OutWorkHandle | ||
| ) |
Tries to creates a new sync work handle that can be used to reserve or request work to happen as part of a sync point. If it was successful, OutWorkHandle will be set to a handle you can pass between threads and later fulfill or abandon.
| void FTaskSyncManager::ReleaseWorldContext | ( | FWorldContextId | WorldContext | ) |
Tells the manager that it should destroy all tracking info for a world context. This only needs to be called when destroying a test or preview world
| void FTaskSyncManager::ReloadRegisteredData | ( | ) |
Refresh the registered data from settings
| void FTaskSyncManager::StartFrame | ( | const UWorld * | InWorld, |
| float | InDeltaSeconds, | ||
| ELevelTick | InTickType | ||
| ) |
Tells the manager that it is the start of a frame, which will register the appropriate events
| void FTaskSyncManager::StartTickGroup | ( | const UWorld * | InWorld, |
| ETickingGroup | TickGroup, | ||
| TArray< FTickFunction * > & | TicksToManualDispatch | ||
| ) |
Tells the manager that a tick group is starting for a specific world
| FTaskSyncResult FTaskSyncManager::TriggerSyncPoint | ( | FSyncPointId | SyncPoint | ) |
Manually triggers a sync point, this can only be called once per frame
| FTaskSyncResult FTaskSyncManager::TriggerSyncPointAfterEvent | ( | FSyncPointId | SyncPoint, |
| FGraphEventRef | EventToWairFor | ||
| ) |
Tells the sync point to trigger at the completion of the passed in event/task, this is only possible if it hasn't already been triggered
Unregisters a sync point, this will only delete if if both the registered and source names match