UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FPrimitiveInstanceDataManager Class Reference

#include <ISMInstanceDataManager.h>

+ Inheritance diagram for FPrimitiveInstanceDataManager:

Public Types

enum class  ETrackingState : uint8 { Initial , Tracked , Disabled , Optimized }
 
enum class  EMode : uint8 { Default , Legacy , ExternalLegacyData }
 

Public Member Functions

ENGINE_API FPrimitiveInstanceDataManager (UPrimitiveComponent *InPrimitiveComponent)
 
ENGINE_API void SetMode (EMode InMode)
 
EMode GetMode () const
 
void Add (int32 InInstanceAddAtIndex, bool bInsert)
 
void RemoveAtSwap (int32 InstanceIndex)
 
void RemoveAt (int32 InstanceIndex)
 
void TransformChanged (int32 InstanceIndex)
 
void TransformChanged (FPrimitiveInstanceId InstanceId)
 
void TransformsChangedAll ()
 
void CustomDataChanged (int32 InstanceIndex)
 
void BakedLightingDataChanged (int32 InstanceIndex)
 
void BakedLightingDataChangedAll ()
 
void NumCustomDataChanged ()
 
void PrimitiveTransformChanged ()
 
ENGINE_API bool HasAnyInstanceChanges () const
 
bool HasAnyChanges () const
 
bool FlushChanges (FInstanceUpdateComponentDesc &&ComponentData, bool bNewPrimitiveProxy)
 
void PostLoad (int32 InNumInstances)
 
void ClearIdTracking (int32 InNumInstances)
 
void ClearChangeTracking ()
 
int32 GetMaxInstanceId () const
 
int32 GetMaxInstanceIndex () const
 
void CreateExplicitIdentityMapping ()
 
ETrackingState GetState () const
 
ENGINE_API TSharedPtr< FISMCInstanceDataSceneProxy, ESPMode::ThreadSafeGetOrCreateProxy (ERHIFeatureLevel::Type InFeatureLevel)
 
const TSharedPtr< FISMCInstanceDataSceneProxy, ESPMode::ThreadSafe > & GetProxy () const
 
void Invalidate (int32 InNumInstances)
 
void ValidateMapping () const
 
ENGINE_API void MarkForRebuildFromLegacy (TUniquePtr< FStaticMeshInstanceData > &&LegacyInstanceData, const TArray< int32 > &InstanceReorderTable, const TArray< TRefCountPtr< HHitProxy > > &HitProxies)
 
ENGINE_API SIZE_T GetAllocatedSize () const
 
void ResetComponentDirtyTracking ()
 
void OnRegister (int32 InNumInstances)
 
void ReadCookedRenderData (FArchive &Ar)
 
- Public Member Functions inherited from FInstanceIdIndexMap
 FInstanceIdIndexMap ()=default
 
bool IsIdentity () const
 
int32 GetMaxInstanceId () const
 
int32 GetMaxInstanceIndex () const
 
bool IsValidId (FPrimitiveInstanceId InstanceId) const
 
int32 IdToIndex (FPrimitiveInstanceId InstanceId) const
 
FPrimitiveInstanceId IndexToId (int32 InstanceIndex) const
 
void SetInvalid (FPrimitiveInstanceId InstanceId)
 
void Update (FPrimitiveInstanceId InstanceId, int32 InstanceIndex)
 
ENGINE_API void Reset (int32 InNumInstances)
 
ENGINE_API void ResizeExplicit (int32 InNumInstances, int32 MaxInstanceId)
 
ENGINE_API void CreateExplicitIdentityMapping ()
 
ENGINE_API void Serialize (FArchive &Ar)
 
ENGINE_API void RebuildFromIndexToIdMap (TArray< FPrimitiveInstanceId > &&InIndexToIdMap, int32 MaxInstanceId)
 

Additional Inherited Members

- Protected Member Functions inherited from FInstanceIdIndexMap
ENGINE_API void RebuildFromIndexToIdMap (int32 MaxInstanceId)
 
- Protected Attributes inherited from FInstanceIdIndexMap
TArray< FPrimitiveInstanceIdIndexToIdMap
 
TArray< int32IdToIndexMap
 
int32 NumInstances = 0
 

Detailed Description

Manager class that tracks changes to instance data within the component, and is responsible for dispatching updates of the proxy. Tracks instance index changes to be able to maintain a persistent ID mapping for use on the render thread. The ID mapping is not serialized and will be reset when the proxy is recreated. Not responsible for storing the component representation of the instance data. NOTE/TODO: This is tied to the ISM use-case, mostly because of legacy (HISM) interactions. Will be refactored and sub-classed or something. Also: Still somewhat tied to the UComponent, which also can be refactored a bit to make it more general.

Member Enumeration Documentation

◆ EMode

Enumerator
Default 
Legacy 
ExternalLegacyData 

◆ ETrackingState

Current tracking state,

Enumerator
Initial 
Tracked 
Disabled 
Optimized 

Constructor & Destructor Documentation

◆ FPrimitiveInstanceDataManager()

FPrimitiveInstanceDataManager::FPrimitiveInstanceDataManager ( UPrimitiveComponent *  InPrimitiveComponent)

Member Function Documentation

◆ Add()

void FPrimitiveInstanceDataManager::Add ( int32  InInstanceAddAtIndex,
bool  bInsert 
)

◆ BakedLightingDataChanged()

void FPrimitiveInstanceDataManager::BakedLightingDataChanged ( int32  InstanceIndex)

◆ BakedLightingDataChangedAll()

void FPrimitiveInstanceDataManager::BakedLightingDataChangedAll ( )

◆ ClearChangeTracking()

void FPrimitiveInstanceDataManager::ClearChangeTracking ( )

Clear all tracked changes (will result in a full update when next one is flushed)

◆ ClearIdTracking()

void FPrimitiveInstanceDataManager::ClearIdTracking ( int32  InNumInstances)

Clear the ID/Index association and reset the mapping to identity & number of instances to the given number. Also clears the change tracking state.

◆ CreateExplicitIdentityMapping()

void FPrimitiveInstanceDataManager::CreateExplicitIdentityMapping ( )

◆ CustomDataChanged()

void FPrimitiveInstanceDataManager::CustomDataChanged ( int32  InstanceIndex)

◆ FlushChanges()

bool FPrimitiveInstanceDataManager::FlushChanges ( FInstanceUpdateComponentDesc &&  ComponentData,
bool  bNewPrimitiveProxy 
)

◆ GetAllocatedSize()

SIZE_T FPrimitiveInstanceDataManager::GetAllocatedSize ( ) const

◆ GetMaxInstanceId()

int32 FPrimitiveInstanceDataManager::GetMaxInstanceId ( ) const

◆ GetMaxInstanceIndex()

int32 FPrimitiveInstanceDataManager::GetMaxInstanceIndex ( ) const

◆ GetMode()

EMode FPrimitiveInstanceDataManager::GetMode ( ) const
inline

◆ GetOrCreateProxy()

TSharedPtr< FISMCInstanceDataSceneProxy, ESPMode::ThreadSafe > FPrimitiveInstanceDataManager::GetOrCreateProxy ( ERHIFeatureLevel::Type  InFeatureLevel)

◆ GetProxy()

const TSharedPtr< FISMCInstanceDataSceneProxy, ESPMode::ThreadSafe > & FPrimitiveInstanceDataManager::GetProxy ( ) const
inline

◆ GetState()

ETrackingState FPrimitiveInstanceDataManager::GetState ( ) const
inline

◆ HasAnyChanges()

bool FPrimitiveInstanceDataManager::HasAnyChanges ( ) const
inline

Returns true if there are explicitly tracked instance changes, or the state is not tracked (because no proxy has been created yet), and the tracking state is not Disabled.

◆ HasAnyInstanceChanges()

bool FPrimitiveInstanceDataManager::HasAnyInstanceChanges ( ) const

◆ Invalidate()

void FPrimitiveInstanceDataManager::Invalidate ( int32  InNumInstances)

◆ MarkForRebuildFromLegacy()

void FPrimitiveInstanceDataManager::MarkForRebuildFromLegacy ( TUniquePtr< FStaticMeshInstanceData > &&  LegacyInstanceData,
const TArray< int32 > &  InstanceReorderTable,
const TArray< TRefCountPtr< HHitProxy > > &  HitProxies 
)

Call to mark the manager as needing a full rebuild & having an external driver for this.

◆ NumCustomDataChanged()

void FPrimitiveInstanceDataManager::NumCustomDataChanged ( )

◆ OnRegister()

void FPrimitiveInstanceDataManager::OnRegister ( int32  InNumInstances)

Called by the corresponding function in the owner UPrimitiveComponent Because of the multifarious ways the engine shoves data into the properties it is possible for the count to get out of sync. Also at this point we may assume that we have no idea of the state of individual members. Thus, this function will reset tracking state to force a full update as well as, conditionally - if the counts are mismatched - reset the ID mapping.

◆ PostLoad()

void FPrimitiveInstanceDataManager::PostLoad ( int32  InNumInstances)

◆ PrimitiveTransformChanged()

void FPrimitiveInstanceDataManager::PrimitiveTransformChanged ( )

◆ ReadCookedRenderData()

void FPrimitiveInstanceDataManager::ReadCookedRenderData ( FArchive Ar)

◆ RemoveAt()

void FPrimitiveInstanceDataManager::RemoveAt ( int32  InstanceIndex)

◆ RemoveAtSwap()

void FPrimitiveInstanceDataManager::RemoveAtSwap ( int32  InstanceIndex)

◆ ResetComponentDirtyTracking()

void FPrimitiveInstanceDataManager::ResetComponentDirtyTracking ( )
inline

◆ SetMode()

void FPrimitiveInstanceDataManager::SetMode ( EMode  InMode)

◆ TransformChanged() [1/2]

void FPrimitiveInstanceDataManager::TransformChanged ( FPrimitiveInstanceId  InstanceId)

◆ TransformChanged() [2/2]

void FPrimitiveInstanceDataManager::TransformChanged ( int32  InstanceIndex)

◆ TransformsChangedAll()

void FPrimitiveInstanceDataManager::TransformsChangedAll ( )

◆ ValidateMapping()

void FPrimitiveInstanceDataManager::ValidateMapping ( ) const
inline

The documentation for this class was generated from the following files: