UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
InstanceDataUpdateUtils.h File Reference
#include "CoreTypes.h"
#include "HAL/UnrealMemory.h"
#include "Math/UnrealMathUtility.h"
#include "Containers/Array.h"
#include "RenderingThread.h"
#include "RenderTransform.h"
#include "InstanceDataSceneProxy.h"
#include "InstanceData/InstanceDataManager.h"
#include "InstanceData/InstanceUpdateChangeSet.h"

Go to the source code of this file.

Classes

struct  FIdentityIndexRemap
 
struct  FSrcIndexRemap
 
struct  FRenderTransformVectorRegister
 

Namespaces

namespace  RenderingSpatialHash
 

Macros

#define INSTANCE_DATA_UPDATE_ENABLE_ASYNC_TASK   1
 

Functions

template<typename DeltaType , typename ValueType , typename IndexRemapType >
void Scatter (const DeltaType &Delta, TArray< ValueType > &OutDest, int32 DestNumElements, TArray< ValueType > &&InSource, const IndexRemapType &IndexRemap, int32 ElementStride=1)
 
template<typename DeltaType , typename ValueType , typename IndexRemapType >
void Scatter (bool bHasData, const DeltaType &Delta, TArray< ValueType > &DestData, int32 NumOutElements, TArray< ValueType > &&InData, const IndexRemapType &IndexRemap, int32 ElementStride=1)
 
template<typename DeltaType , typename ValueType , typename InValueArrayType >
void Gather (const DeltaType &Delta, TArray< ValueType > &OutDest, const InValueArrayType &InSource, int32 ElementStride=1)
 
template<typename ValueType >
void CondMove (bool bCondition, TArray< ValueType > &Data, int32 FromIndex, int32 ToIndex, int32 NumElements=1)
 
FORCEINLINE_DEBUGGABLE FRenderTransform VectorMatrixMultiply (const FRenderTransform &LocalToPrimitive, const FRenderTransformVectorRegister &PrimitiveToWorld)
 
template<typename DeltaType , typename IndexRemapType >
FORCEINLINE void ApplyTransformUpdates (const DeltaType &DeltaRange, const IndexRemapType &IndexRemap, const FRenderTransform &PrimitiveToRelativeWorld, const TArray< FRenderTransform > &InstanceTransforms, int32 PostUpdateNumTransforms, TArray< FRenderTransform > &OutInstanceToPrimitiveRelative)
 
FVector3f GetLocalBoundsPadExtent (const FRenderTransform &LocalToWorld, float PadAmount)
 
template<typename IndexRemapType >
void UpdateIdMapping (FInstanceUpdateChangeSet &ChangeSet, const IndexRemapType &IndexRemap, FInstanceIdIndexMap &OutInstanceIdIndexMap)
 
template<typename IndexRemapType >
void ApplyAttributeChanges (FInstanceUpdateChangeSet &ChangeSet, const IndexRemapType &IndexRemap, FInstanceSceneDataBuffers::FWriteView &ProxyData)
 
template<typename TaskLambdaType >
void BeginInstanceDataUpdateTask (FInstanceDataUpdateTaskInfo &InstanceDataUpdateTaskInfo, TaskLambdaType &&TaskLambda, const FInstanceDataBufferHeader &InInstanceDataBufferHeader)
 
template<typename ProxyType , typename TaskLambdaType >
void DispatchInstanceDataUpdateTask (bool bIsUnattached, const TSharedPtr< ProxyType, ESPMode::ThreadSafe > &InstanceDataProxy, const FInstanceDataBufferHeader &InstanceDataBufferHeader, TaskLambdaType &&TaskLambda)
 
template<typename ScalarType >
FArchiveRenderingSpatialHash::operator<< (FArchive &Ar, TLocation< ScalarType > &Item)
 
FArchiveoperator<< (FArchive &Ar, FInstanceSceneDataBuffers::FCompressedSpatialHashItem &Item)
 

Macro Definition Documentation

◆ INSTANCE_DATA_UPDATE_ENABLE_ASYNC_TASK

#define INSTANCE_DATA_UPDATE_ENABLE_ASYNC_TASK   1

Function Documentation

◆ ApplyAttributeChanges()

void ApplyAttributeChanges ( FInstanceUpdateChangeSet ChangeSet,
const IndexRemapType IndexRemap,
FInstanceSceneDataBuffers::FWriteView ProxyData 
)
inline

◆ ApplyTransformUpdates()

FORCEINLINE void ApplyTransformUpdates ( const DeltaType DeltaRange,
const IndexRemapType IndexRemap,
const FRenderTransform PrimitiveToRelativeWorld,
const TArray< FRenderTransform > &  InstanceTransforms,
int32  PostUpdateNumTransforms,
TArray< FRenderTransform > &  OutInstanceToPrimitiveRelative 
)

Helper function to apply transform update that selectively performs Orthogonalize only if the primitive transform has any non-uniform scale.

◆ BeginInstanceDataUpdateTask()

template<typename TaskLambdaType >
void BeginInstanceDataUpdateTask ( FInstanceDataUpdateTaskInfo InstanceDataUpdateTaskInfo,
TaskLambdaType &&  TaskLambda,
const FInstanceDataBufferHeader InInstanceDataBufferHeader 
)

◆ CondMove()

template<typename ValueType >
void CondMove ( bool  bCondition,
TArray< ValueType > &  Data,
int32  FromIndex,
int32  ToIndex,
int32  NumElements = 1 
)

Helper function to conditionally move a single element

◆ DispatchInstanceDataUpdateTask()

template<typename ProxyType , typename TaskLambdaType >
void DispatchInstanceDataUpdateTask ( bool  bIsUnattached,
const TSharedPtr< ProxyType, ESPMode::ThreadSafe > &  InstanceDataProxy,
const FInstanceDataBufferHeader InstanceDataBufferHeader,
TaskLambdaType &&  TaskLambda 
)

◆ Gather()

void Gather ( const DeltaType Delta,
TArray< ValueType > &  OutDest,
const InValueArrayType InSource,
int32  ElementStride = 1 
)

Gather the needed values from InSource to OutDest, according to the delta. If there is no delta, it will perform a bulk copy.

◆ GetLocalBoundsPadExtent()

FVector3f GetLocalBoundsPadExtent ( const FRenderTransform LocalToWorld,
float  PadAmount 
)
inline

◆ operator<<()

FArchive & operator<< ( FArchive Ar,
FInstanceSceneDataBuffers::FCompressedSpatialHashItem Item 
)
inline

◆ Scatter() [1/2]

void Scatter ( bool  bHasData,
const DeltaType Delta,
TArray< ValueType > &  DestData,
int32  NumOutElements,
TArray< ValueType > &&  InData,
const IndexRemapType IndexRemap,
int32  ElementStride = 1 
)
inline

Also takes a flag to optionally reset the array in case the attribute is disabled

◆ Scatter() [2/2]

void Scatter ( const DeltaType Delta,
TArray< ValueType > &  OutDest,
int32  DestNumElements,
TArray< ValueType > &&  InSource,
const IndexRemapType IndexRemap,
int32  ElementStride = 1 
)

Write InSource that was previously gathered using the above methods to the final destination array OutDest using the same delta information. If there is no delta and the index remap is identity, it performs a move of the source data to the final array, saving a malloc & copy.

◆ UpdateIdMapping()

void UpdateIdMapping ( FInstanceUpdateChangeSet ChangeSet,
const IndexRemapType IndexRemap,
FInstanceIdIndexMap OutInstanceIdIndexMap 
)
inline

◆ VectorMatrixMultiply()

FORCEINLINE_DEBUGGABLE FRenderTransform VectorMatrixMultiply ( const FRenderTransform LocalToPrimitive,
const FRenderTransformVectorRegister PrimitiveToWorld 
)