UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TInstanceCullingLoadBalancer< InAllocatorType > Class Template Reference

#include <InstanceCullingLoadBalancer.h>

+ Inheritance diagram for TInstanceCullingLoadBalancer< InAllocatorType >:

Classes

struct  FData
 

Public Types

using AllocatorType = InAllocatorType
 

Public Member Functions

void ReserveStorage (int32 NumBatches, int32 NumItems)
 
void Add (uint32 InstanceDataOffset, uint32 NumInstanceDataEntries, uint32 Payload)
 
bool IsEmpty () const
 
FGPUData Upload (FRDGBuilder &GraphBuilder, int32 NumGroupsPerBatch=1)
 
FGPUData UploadFinalized (FRDGBuilder &GraphBuilder, int32 NumGroupsPerBatch=1) const
 
void FinalizeBatches ()
 
FIntVector GetWrappedCsGroupCount (int32 NumGroupsPerBatch=1) const
 
const TArray< FPackedBatch, AllocatorType > & GetBatches () const
 
const TArray< FPackedItem, AllocatorType > & GetItems () const
 
uint32 GetTotalNumInstances () const
 
template<typename AllocatorType >
void AppendData (const TInstanceCullingLoadBalancer< AllocatorType > &Other)
 
bool HasSingleInstanceItemsOnly () const
 
- Public Member Functions inherited from FInstanceCullingLoadBalancerBase
FPackedBatch PackBatch (uint32 FirstItem, uint32 NumItems)
 
FPackedItem PackItem (uint32 InstanceDataOffset, uint32 NumInstances, uint32 Payload, uint32 BatchPrefixSum)
 
FGPUData Upload (FRDGBuilder &GraphBuilder, TConstArrayView< FPackedBatch > Batches, TConstArrayView< FPackedItem > Items, ERDGInitialDataFlags RDGInitialDataFlags, int32 NumGroupsPerBatch) const
 
FIntVector GetWrappedCsGroupCount (TConstArrayView< FPackedBatch > Batches, int32 NumGroupsPerBatch) const
 

Protected Attributes

TRefCountPtr< FDataData { new FData }
 
uint32 CurrentBatchPrefixSum = 0u
 
uint32 CurrentBatchNumItems = 0U
 
uint32 CurrentBatchPackedPrefixSum = 0U
 
uint32 CurrentBatchFirstItem = 0U
 
uint32 TotalInstances = 0U
 

Additional Inherited Members

- Static Public Member Functions inherited from FInstanceCullingLoadBalancerBase
static void SetShaderDefines (FShaderCompilerEnvironment &OutEnvironment)
 
- Static Public Attributes inherited from FInstanceCullingLoadBalancerBase
static constexpr uint32 ThreadGroupSize = 64U
 
static constexpr uint32 PrefixBits = 6U
 
static constexpr uint32 PrefixBitMask = (1U << PrefixBits) - 1U
 
static constexpr uint32 NumInstancesItemBits = PrefixBits + 1U
 
static constexpr uint32 NumInstancesItemMask = (1U << NumInstancesItemBits) - 1U
 

Member Typedef Documentation

◆ AllocatorType

template<typename InAllocatorType = FDefaultAllocator>
using TInstanceCullingLoadBalancer< InAllocatorType >::AllocatorType = InAllocatorType

Member Function Documentation

◆ Add()

template<typename InAllocatorType = FDefaultAllocator>
void TInstanceCullingLoadBalancer< InAllocatorType >::Add ( uint32  InstanceDataOffset,
uint32  NumInstanceDataEntries,
uint32  Payload 
)
inline

Add a span of instances to be processed.

◆ AppendData()

template<typename InAllocatorType = FDefaultAllocator>
template<typename AllocatorType >
void TInstanceCullingLoadBalancer< InAllocatorType >::AppendData ( const TInstanceCullingLoadBalancer< AllocatorType > &  Other)
inline

◆ FinalizeBatches()

template<typename InAllocatorType = FDefaultAllocator>
void TInstanceCullingLoadBalancer< InAllocatorType >::FinalizeBatches ( )
inline

Call when finished adding work items to the balancer to flush any in-progress batches.

◆ GetBatches()

template<typename InAllocatorType = FDefaultAllocator>
const TArray< FPackedBatch, AllocatorType > & TInstanceCullingLoadBalancer< InAllocatorType >::GetBatches ( ) const
inline

◆ GetItems()

template<typename InAllocatorType = FDefaultAllocator>
const TArray< FPackedItem, AllocatorType > & TInstanceCullingLoadBalancer< InAllocatorType >::GetItems ( ) const
inline

◆ GetTotalNumInstances()

template<typename InAllocatorType = FDefaultAllocator>
uint32 TInstanceCullingLoadBalancer< InAllocatorType >::GetTotalNumInstances ( ) const
inline

◆ GetWrappedCsGroupCount()

template<typename InAllocatorType = FDefaultAllocator>
FIntVector TInstanceCullingLoadBalancer< InAllocatorType >::GetWrappedCsGroupCount ( int32  NumGroupsPerBatch = 1) const
inline

Returns a 3D group count that is large enough to generate one group per batch using FComputeShaderUtils::GetGroupCountWrapped. Use GetUnWrappedDispatchGroupId in the shader to retrieve the linear index. NOTE: NumGroupsPerBatch must be consistent with the value passed to Upload

◆ HasSingleInstanceItemsOnly()

template<typename InAllocatorType = FDefaultAllocator>
bool TInstanceCullingLoadBalancer< InAllocatorType >::HasSingleInstanceItemsOnly ( ) const
inline

◆ IsEmpty()

template<typename InAllocatorType = FDefaultAllocator>
bool TInstanceCullingLoadBalancer< InAllocatorType >::IsEmpty ( ) const
inline

◆ ReserveStorage()

template<typename InAllocatorType = FDefaultAllocator>
void TInstanceCullingLoadBalancer< InAllocatorType >::ReserveStorage ( int32  NumBatches,
int32  NumItems 
)
inline

◆ Upload()

template<typename InAllocatorType = FDefaultAllocator>
FGPUData TInstanceCullingLoadBalancer< InAllocatorType >::Upload ( FRDGBuilder GraphBuilder,
int32  NumGroupsPerBatch = 1 
)
inline

◆ UploadFinalized()

template<typename InAllocatorType = FDefaultAllocator>
FGPUData TInstanceCullingLoadBalancer< InAllocatorType >::UploadFinalized ( FRDGBuilder GraphBuilder,
int32  NumGroupsPerBatch = 1 
) const
inline

Member Data Documentation

◆ CurrentBatchFirstItem

template<typename InAllocatorType = FDefaultAllocator>
uint32 TInstanceCullingLoadBalancer< InAllocatorType >::CurrentBatchFirstItem = 0U
protected

◆ CurrentBatchNumItems

template<typename InAllocatorType = FDefaultAllocator>
uint32 TInstanceCullingLoadBalancer< InAllocatorType >::CurrentBatchNumItems = 0U
protected

◆ CurrentBatchPackedPrefixSum

template<typename InAllocatorType = FDefaultAllocator>
uint32 TInstanceCullingLoadBalancer< InAllocatorType >::CurrentBatchPackedPrefixSum = 0U
protected

◆ CurrentBatchPrefixSum

template<typename InAllocatorType = FDefaultAllocator>
uint32 TInstanceCullingLoadBalancer< InAllocatorType >::CurrentBatchPrefixSum = 0u
protected

◆ Data

template<typename InAllocatorType = FDefaultAllocator>
TRefCountPtr<FData> TInstanceCullingLoadBalancer< InAllocatorType >::Data { new FData }
protected

◆ TotalInstances

template<typename InAllocatorType = FDefaultAllocator>
uint32 TInstanceCullingLoadBalancer< InAllocatorType >::TotalInstances = 0U
protected

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