UActorComponent::RequiresPreEndOfFrameSync
#include "Components/ActorComponent.h"
Access: public
Specifiers: virtual
Description
Returns whether this component needs the engine to sync all outstanding async tasks before end-of-frame updates execute. Used to guarantee that worker-thread tasks have flushed before the update reads their results.
Caveats & Gotchas
- • Forcing a pre-end-of-frame sync is a global stall — it waits for all registered tasks to complete, not just those related to this component, so overuse can eliminate frame parallelism.
- • The base implementation returns false; only override to return true if your end-of-frame update reads data produced by an engine-registered async task.
- • Consider redesigning the component to use a completion callback rather than a sync stall before resorting to this override.
Signature
ENGINE_API virtual bool RequiresPreEndOfFrameSync() const; Return Type
bool Example
Request pre-end-of-frame sync for an async-computed mesh C++
bool UMyAsyncMeshComponent::RequiresPreEndOfFrameSync() const
{
// Our SendRenderDynamicData reads results from an async cooking task
return bCookingTaskPending;
} See Also
Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?