UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SkeletalMeshUpdate.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4SkeletalMeshUpdate.h: Helpers to stream in and out skeletal mesh LODs.
5=============================================================================*/
6
7#pragma once
8
9#include "CoreMinimal.h"
10#include "Engine/SkeletalMesh.h"
11#include "IO/IoDispatcher.h"
12#include "RenderAssetUpdate.h"
16#include "RayTracingGeometry.h"
17
18#define UE_API ENGINE_API
19
20
22
53
55
73
75{
76public:
77 UE_API FSkeletalMeshStreamIn(const USkeletalMesh* InMesh, EThreadType CreateResourcesThread);
78
80
81protected:
100
101#if RHI_RAYTRACING
103 {
104 private:
107 bool bRequiresBuild = false;
108
109 public:
110 void CreateFromCPUData(FRHICommandListBase& RHICmdList, FRayTracingGeometry& RayTracingGeometry);
111
112 void SafeRelease();
113
115 };
116#endif
117
119 UE_API void CreateBuffers(const FContext& Context);
120
122 UE_API void DiscardNewLODs(const FContext& Context);
123
125 UE_API void DoFinishUpdate(const FContext& Context);
126
128 UE_API void DoCancel(const FContext& Context);
129
131 FIntermediateBuffers IntermediateBuffersArray[MAX_MESH_LOD_COUNT];
132
133#if RHI_RAYTRACING
135#endif
136
138 FRHICommandList* StreamingRHICmdList = nullptr;
139
142};
143
145{
146public:
148
150
151private:
152
153 int32 NumReferenceChecks = 0;
154 uint32 PreviousNumberOfExternalReferences = 0;
155
156
158 void ConditionalMarkComponentsDirty(const FContext& Context);
159
161 void WaitForReferences(const FContext& Context);
162
164 void ReleaseBuffers(const FContext& Context);
165
167 void Cancel(const FContext& Context);
168};
169
171{
172public:
174
176
177 virtual void Abort() override;
178
179protected:
197
200
202 void SetIORequest(const FContext& Context);
203
205 void ClearIORequest(const FContext& Context);
206
208 void ReportIOError(const FContext& Context);
209
211 void SerializeLODData(const FContext& Context);
212
214 void Cancel(const FContext& Context);
215
217 void CancelIORequest();
218
221
224
226
227 // Whether an IO error was detected (when files do not exists).
228 bool bFailedOnIOError = false;
229
230 void DoInitiateIO(const FContext& Context);
231
233
234 void DoCreateBuffers(const FContext& Context);
235
236 void DoCancelIO(const FContext& Context);
237};
238
239#if WITH_EDITOR
241{
242public:
243 FSkeletalMeshStreamIn_DDC(const USkeletalMesh* InMesh, EThreadType CreateResourcesThread);
244
245 virtual ~FSkeletalMeshStreamIn_DDC() {}
246
247protected:
248 void LoadNewLODsFromDDC(const FContext& Context);
249
250private:
252 void DoLoadNewLODsFromDDC(const FContext& Context);
253
255 void DoCreateBuffers(const FContext& Context);
256};
257#endif
258
259#undef UE_API
#define FORCEINLINE
Definition AndroidPlatform.h:140
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define RETURN_QUICK_DECLARE_CYCLE_STAT(StatId, GroupId)
Definition Stats.h:655
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ MAX_MESH_LOD_COUNT
Definition RHIDefinitions.h:271
#define UE_API
Definition SkeletalMeshUpdate.h:18
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition AsyncWork.h:63
Definition BulkData.h:1295
Definition IoBuffer.h:15
Definition AsyncWork.h:663
Definition RHICommandList.h:455
Definition RHICommandList.h:3819
Definition RHIResourceReplace.h:55
Definition RayTracingGeometry.h:31
virtual void Abort()
Definition RenderAssetUpdate.h:81
EThreadType
Definition RenderAssetUpdate.h:43
Definition SkeletalMeshLODRenderData.h:128
Definition SkeletalMeshRenderData.h:17
Definition SkeletalMeshUpdate.h:181
FCancelIORequestsTask(FSkeletalMeshStreamIn_IO *InPendingUpdate)
Definition SkeletalMeshUpdate.h:183
void DoWork()
Definition SkeletalMeshUpdate.cpp:413
FORCEINLINE TStatId GetStatId() const
Definition SkeletalMeshUpdate.h:189
Definition SkeletalMeshUpdate.h:171
bool bHighPrioIORequest
Definition SkeletalMeshUpdate.h:225
void CancelIORequest()
Definition SkeletalMeshUpdate.cpp:600
FBulkDataBatchRequest BulkDataRequest
Definition SkeletalMeshUpdate.h:220
void SetIORequest(const FContext &Context)
Definition SkeletalMeshUpdate.cpp:438
void SerializeLODData(const FContext &Context)
Definition SkeletalMeshUpdate.cpp:542
FAutoDeleteAsyncTask< FCancelIORequestsTask > FAsyncCancelIORequestsTask
Definition SkeletalMeshUpdate.h:198
void DoCreateBuffers(const FContext &Context)
Definition SkeletalMeshUpdate.cpp:635
bool bFailedOnIOError
Definition SkeletalMeshUpdate.h:228
void ReportIOError(const FContext &Context)
Definition SkeletalMeshUpdate.cpp:527
void DoInitiateIO(const FContext &Context)
Definition SkeletalMeshUpdate.cpp:615
virtual ~FSkeletalMeshStreamIn_IO()
Definition SkeletalMeshUpdate.h:175
void DoCancelIO(const FContext &Context)
Definition SkeletalMeshUpdate.cpp:649
virtual void Abort() override
Definition SkeletalMeshUpdate.cpp:423
FIoBuffer BulkData
Definition SkeletalMeshUpdate.h:223
void ClearIORequest(const FContext &Context)
Definition SkeletalMeshUpdate.cpp:515
void DoSerializeLODData(const FContext &Context)
Definition SkeletalMeshUpdate.cpp:624
Definition SkeletalMeshUpdate.h:75
const EThreadType CreateResourcesThread
Definition SkeletalMeshUpdate.h:141
Definition SkeletalMeshUpdate.h:145
virtual ~FSkeletalMeshStreamOut()
Definition SkeletalMeshUpdate.h:149
Definition SkeletalMeshUpdate.h:62
virtual void Abort()
Definition SkeletalMeshUpdate.h:68
virtual ~FSkeletalMeshUpdate()
Definition SkeletalMeshUpdate.h:66
Definition ArrayView.h:139
Definition Array.h:670
Definition RenderAssetUpdate.h:243
FSkelMeshUpdateContext FContext
Definition RenderAssetUpdate.h:246
Definition SkeletalMesh.h:440
Definition StreamableRenderAsset.h:37
Definition RHIResources.h:3496
Definition SkeletalMeshUpdate.h:29
EThreadType CurrentThread
Definition SkeletalMeshUpdate.h:51
EThreadType GetCurrentThread() const
Definition SkeletalMeshUpdate.h:36
FSkeletalMeshRenderData * RenderData
Definition SkeletalMeshUpdate.h:44
TArrayView< FSkeletalMeshLODRenderData * > LODResourcesView
Definition SkeletalMeshUpdate.h:46
const USkeletalMesh * Mesh
Definition SkeletalMeshUpdate.h:42
int32 EThreadType
Definition SkeletalMeshUpdate.h:30
int32 AssetLODBias
Definition SkeletalMeshUpdate.h:48
Definition SkeletalMeshHalfEdgeBuffer.h:26
Definition SkeletalMeshUpdate.h:84
FSkeletalMeshHalfEdgeBuffer::FRHIInfo HalfEdgeBuffer
Definition SkeletalMeshUpdate.h:93
TArray< TPair< FSkinWeightProfileStack, FSkinWeightRHIInfo > > AltSkinWeightVertexBuffers
Definition SkeletalMeshUpdate.h:92
FBufferRHIRef TangentsVertexBuffer
Definition SkeletalMeshUpdate.h:85
FBufferRHIRef PositionVertexBuffer
Definition SkeletalMeshUpdate.h:87
FSkinWeightRHIInfo SkinWeightVertexBuffer
Definition SkeletalMeshUpdate.h:89
FBufferRHIRef TexCoordVertexBuffer
Definition SkeletalMeshUpdate.h:86
FBufferRHIRef ColorVertexBuffer
Definition SkeletalMeshUpdate.h:88
FBufferRHIRef IndexBuffer
Definition SkeletalMeshUpdate.h:91
FBufferRHIRef ClothVertexBuffer
Definition SkeletalMeshUpdate.h:90
Definition SkinWeightProfile.h:133
Definition SkinWeightVertexBuffer.h:66
Definition LightweightStats.h:416