UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
InstanceCullingMergedContext.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
8
10{
11public:
13
15 {
18 // EBatchProcessingMode::Generic batches are put in bins, based on their view's PrevHZB
20 };
21
22 // Info about a batch of culling work produced by a context, when part of a batched job
23 // Store once per context, provides start offsets to commands/etc for the context.
36
38 static constexpr uint32 FirstGenericBinIndex = 1;
39
42
45
50 //TArray<FMeshDrawCommandInfo, SceneRenderingAllocator> MeshDrawCommandInfos;
57
58 // these are the actual BINS, so we would need one per HZB
62
64 // if true, the contexts that are supplied through calling AddBatch must all have an 1:1 entry in the resulting merged Batches array
65 // this adds a check to prevent empty contexts from being added (!HasCullingCommands()).
66 bool bMustAddAllContexts = false;
67 // Counters to sum up all sizes to facilitate pre-sizing
69 // preallocate 5 to cover all scenarios up to UnCulled bin + 4 HZBs in case of 4 primary views
79
81
82 // Merge the queued batches and populate the derived data.
83 void MergeBatches();
84
85
87
88private:
89 void AddBatchItem(const FBatchItem& BatchItem);
90
91 int32 GetLoadBalancerIndex(EBatchProcessingMode Mode, const FBatchItem& BatchItem);
92
93};
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EBatchProcessingMode
Definition InstanceCullingContext.h:59
EShaderPlatform
Definition RHIShaderPlatform.h:11
@ SP_NumPlatforms
Definition RHIShaderPlatform.h:55
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition InstanceCullingContext.h:74
Definition InstanceCullingMergedContext.h:10
TArray< FInstanceCullingContext::FCompactionData, SceneRenderingAllocator > DrawCommandCompactionData
Definition InstanceCullingMergedContext.h:55
TArray< TArray< uint32, SceneRenderingAllocator >, SceneRenderingAllocator > BatchInds
Definition InstanceCullingMergedContext.h:60
uint32 InstanceIdBufferElements
Definition InstanceCullingMergedContext.h:68
int32 TotalViewIds
Definition InstanceCullingMergedContext.h:74
TArray< int32, SceneRenderingAllocator > ViewIds
Definition InstanceCullingMergedContext.h:49
TArray< int32, TInlineAllocator< 5 > > TotalItems
Definition InstanceCullingMergedContext.h:71
static constexpr uint32 FirstGenericBinIndex
Definition InstanceCullingMergedContext.h:38
int32 TotalCompactionBlocks
Definition InstanceCullingMergedContext.h:77
TArray< FInstanceCullingContext::FPayloadData, SceneRenderingAllocator > PayloadData
Definition InstanceCullingMergedContext.h:53
TArray< FContextBatchInfoPacked, SceneRenderingAllocator > BatchInfos
Definition InstanceCullingMergedContext.h:61
TArray< uint32, SceneRenderingAllocator > InstanceIdOffsets
Definition InstanceCullingMergedContext.h:54
int32 TotalInstances
Definition InstanceCullingMergedContext.h:75
TArray< FBatchItem, SceneRenderingAllocator > Batches
Definition InstanceCullingMergedContext.h:41
void MergeBatches()
Definition InstanceCullingMergedContext.cpp:29
int32 TotalCompactionDrawCommands
Definition InstanceCullingMergedContext.h:76
int32 TotalCompactionInstances
Definition InstanceCullingMergedContext.h:78
EShaderPlatform ShaderPlatform
Definition InstanceCullingMergedContext.h:63
TArray< uint32, SceneRenderingAllocator > CompactionBlockDataIndices
Definition InstanceCullingMergedContext.h:56
TArray< int32, TInlineAllocator< 5 > > TotalBatches
Definition InstanceCullingMergedContext.h:70
void AddBatch(FRDGBuilder &GraphBuilder, FInstanceCullingContext *Context, FInstanceCullingDrawParams *InstanceCullingDrawParams)
Definition InstanceCullingMergedContext.cpp:157
TArray< FBatchItem, SceneRenderingAllocator > AsyncBatches
Definition InstanceCullingMergedContext.h:44
TArray< TInstanceCullingLoadBalancer< SceneRenderingAllocator >, SceneRenderingAllocator > LoadBalancers
Definition InstanceCullingMergedContext.h:59
int32 NumCullingViews
Definition InstanceCullingMergedContext.h:80
TArray< FUintVector2, SceneRenderingAllocator > DrawCommandDescs
Definition InstanceCullingMergedContext.h:52
int32 TotalPayloads
Definition InstanceCullingMergedContext.h:73
int32 TotalIndirectArgs
Definition InstanceCullingMergedContext.h:72
bool bMustAddAllContexts
Definition InstanceCullingMergedContext.h:66
TArray< FRHIDrawIndexedIndirectParameters, SceneRenderingAllocator > IndirectArgs
Definition InstanceCullingMergedContext.h:51
Definition RenderGraphBuilder.h:49
Definition Array.h:670
Definition ConcurrentLinearAllocator.h:624
Definition InstanceCullingMergedContext.h:15
int32 GenericBinIndex
Definition InstanceCullingMergedContext.h:19
FInstanceCullingContext * Context
Definition InstanceCullingMergedContext.h:16
FInstanceCullingDrawParams * Result
Definition InstanceCullingMergedContext.h:17
Definition InstanceCullingMergedContext.h:25
uint32 InstanceDataWriteOffset
Definition InstanceCullingMergedContext.h:27
uint32 DynamicInstanceIdMax
Definition InstanceCullingMergedContext.h:33
uint32 IndirectArgsOffset
Definition InstanceCullingMergedContext.h:26
uint32 NumViewIds_bAllowOcclusionCulling
Definition InstanceCullingMergedContext.h:31
uint32 PayloadDataOffset
Definition InstanceCullingMergedContext.h:28
uint32 ViewIdsOffset
Definition InstanceCullingMergedContext.h:30
uint32 DynamicInstanceIdOffset
Definition InstanceCullingMergedContext.h:32
uint32 ItemDataOffset[uint32(EBatchProcessingMode::Num)]
Definition InstanceCullingMergedContext.h:34
uint32 CompactionDataOffset
Definition InstanceCullingMergedContext.h:29