UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AsyncRegisterLevelContext.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Tasks/Task.h"
7
8class ULevel;
10class UPrimitiveComponent;
11
13
15{
16private:
20 void AddPrimitive(UPrimitiveComponent* InComponent);
22 bool Tick();
23 void Flush();
24 bool IsRunningAsync() const;
25 bool HasRemainingWork() const;
26 void WaitForAsyncTask();
27
28 struct FAddPrimitivesTask
29 {
30 public:
32 bool IsValid() const;
33 bool IsCompleted() const;
34 void Wait();
35 void Reset();
37 static void Execute(UPrimitiveComponent* Component, FSceneInterface* InScene, bool bAppCanEverRender);
38
41 };
42
44 FPrimitiveBatch NextBatch;
45 TArray<FPrimitiveBatch> AddPrimitivesArray;
46 FAddPrimitivesTask AsyncTask;
48};
49
51{
52private:
56 void AddSendRenderDynamicData(UPrimitiveComponent* InComponent);
58 bool Tick();
59 void Flush();
60 bool IsRunningAsync() const { return false; }
61 bool HasRemainingWork() const;
62 void WaitForAsyncTask() {}
63
65 FPrimitiveBatch NextBatch;
66 TArray<FPrimitiveBatch> SendRenderDynamicDataPrimitivesArray;
68};
69
71{
72public:
75 void AddPrimitive(UPrimitiveComponent* InComponent);
76 void AddSendRenderDynamicData(UPrimitiveComponent* InComponent);
77 void SetCanLaunchNewTasks(bool bValue);
79 bool GetIncrementalRegisterComponentsDone() const { return bIncrementalRegisterComponentsDone; }
80 bool Tick();
81 bool IsRunningAsync() const;
82 bool HasRemainingWork() const;
83 void WaitForAsyncTasks();
84
85private:
86 void Flush();
87
88 ULevel* Level;
89 FAsyncAddPrimitiveQueue AsyncAddPrimitiveQueue;
90 FSendRenderDynamicDataPrimitivesQueue SendRenderDynamicDataPrimitivesQueue;
91 bool bCanLaunchNewTasks;
92 bool bIncrementalRegisterComponentsDone;
93
96};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE_FORCEINLINE_HINT bool IsValid(const UObject *Test)
Definition Object.h:1875
Definition SceneInterface.h:106
Definition Launch.Build.cs:10
Definition ConcurrentLinearAllocator.h:624
Definition UniquePtr.h:107
Definition Task.h:191
Definition Level.h:423
Definition AsyncRegisterLevelContext.h:15
Definition AsyncRegisterLevelContext.h:71
void AddPrimitive(UPrimitiveComponent *InComponent)
Definition AsyncRegisterLevelContext.cpp:61
void SetIncrementalRegisterComponentsDone(bool bValue)
Definition AsyncRegisterLevelContext.cpp:75
bool GetIncrementalRegisterComponentsDone() const
Definition AsyncRegisterLevelContext.h:79
void AddSendRenderDynamicData(UPrimitiveComponent *InComponent)
Definition AsyncRegisterLevelContext.cpp:68
static TUniquePtr< FAsyncRegisterLevelContext > CreateInstance(ULevel *InLevel)
Definition AsyncRegisterLevelContext.cpp:34
bool Tick()
Definition AsyncRegisterLevelContext.cpp:112
bool HasRemainingWork() const
Definition AsyncRegisterLevelContext.cpp:89
bool IsRunningAsync() const
Definition AsyncRegisterLevelContext.cpp:94
void WaitForAsyncTasks()
Definition AsyncRegisterLevelContext.cpp:99
void SetCanLaunchNewTasks(bool bValue)
Definition AsyncRegisterLevelContext.cpp:84
Definition AsyncRegisterLevelContext.h:51