#include <InstanceCullingContext.h>
|
| | FInstanceCullingContext () |
| |
| | FInstanceCullingContext (EShaderPlatform ShaderPlatform, FInstanceCullingManager *InInstanceCullingManager, TArrayView< const int32 > InViewIds, const TRefCountPtr< IPooledRenderTarget > &InPrevHZB, EInstanceCullingMode InInstanceCullingMode=EInstanceCullingMode::Normal, EInstanceCullingFlags InFlags=EInstanceCullingFlags::None, EBatchProcessingMode InSingleInstanceProcessingMode=EBatchProcessingMode::UnCulled) |
| |
| RENDERER_API | FInstanceCullingContext (const TCHAR *PassName, EShaderPlatform ShaderPlatform, FInstanceCullingManager *InInstanceCullingManager, TArrayView< const int32 > InViewIds, const TRefCountPtr< IPooledRenderTarget > &InPrevHZB, EInstanceCullingMode InInstanceCullingMode=EInstanceCullingMode::Normal, EInstanceCullingFlags InFlags=EInstanceCullingFlags::None, EBatchProcessingMode InSingleInstanceProcessingMode=EBatchProcessingMode::UnCulled) |
| |
| RENDERER_API | ~FInstanceCullingContext () |
| |
| void | ResetCommands (int32 MaxNumCommands) |
| |
| bool | IsEnabled () const |
| |
| bool | IsInstanceOrderPreservationEnabled () const |
| |
| void | AddInstancesToDrawCommand (uint32 IndirectArgsOffset, int32 InstanceDataOffset, uint32 RunOffset, uint32 NumInstances, EInstanceFlags InstanceFlags) |
| |
| void | AddInstancesToDrawCommand (uint32 IndirectArgsOffset, int32 InstanceDataOffset, uint32 RunOffset, uint32 NumInstances, EInstanceFlags InstanceFlags, uint32 MaxBatchSize) |
| |
| void | AddInstanceRunsToDrawCommand (uint32 IndirectArgsOffset, int32 InstanceDataOffset, const uint32 *Runs, uint32 NumRuns, EInstanceFlags InstanceFlags, uint32 MaxBatchSize) |
| |
| uint32 | AllocateIndirectArgs (const FMeshDrawCommand *MeshDrawCommand) |
| |
| uint32 | StepInstanceDataOffsetBytes (uint32 NumStepDraws) const |
| |
| uint32 | GetInstanceIdNumElements () const |
| |
| void | BeginAsyncSetup (SyncPrerequisitesFuncType &&InSyncPrerequisitesFunc) |
| |
| void | WaitForSetupTask () |
| |
| void | SetDynamicPrimitiveInstanceOffsets (int32 InDynamicInstanceIdOffset, int32 InDynamicInstanceIdNum) |
| |
| void | BuildRenderingCommands (FRDGBuilder &GraphBuilder, const FGPUScene &GPUScene, int32 InDynamicInstanceIdOffset, int32 InDynamicInstanceIdNum, FInstanceCullingResult &Results) |
| |
| void | BuildRenderingCommands (FRDGBuilder &GraphBuilder, const FGPUScene &GPUScene, FInstanceCullingDrawParams *InstanceCullingDrawParams) |
| |
| bool | HasCullingCommands () const |
| |
| EInstanceCullingMode | GetInstanceCullingMode () const |
| |
| void | SetupDrawCommands (FMeshCommandOneFrameArray &VisibleMeshDrawCommandsInOut, bool bCompactIdenticalCommands, const FScene *Scene, int32 &MaxInstancesOut, int32 &VisibleMeshDrawCommandsNumOut, int32 &NewPassVisibleMeshDrawCommandsNumOut) |
| |
| void | SubmitDrawCommands (const FMeshCommandOneFrameArray &VisibleMeshDrawCommands, const FGraphicsMinimalPipelineStateSet &GraphicsMinimalPipelineStateSet, const FMeshDrawCommandOverrideArgs &OverrideArgs, int32 StartIndex, int32 NumMeshDrawCommands, uint32 InstanceFactor, FRHICommandList &RHICmdList) const |
| |
| void | BuildRenderingCommandsInternal (FRDGBuilder &GraphBuilder, const FGPUScene &GPUScene, EAsyncProcessingMode AsyncProcessingMode, FInstanceCullingDrawParams *InstanceCullingDrawParams) |
| |
|
| FInstanceCullingManager * | InstanceCullingManager = nullptr |
| |
| EShaderPlatform | ShaderPlatform = SP_NumPlatforms |
| |
| TArray< int32, TInlineAllocator< 6, SceneRenderingAllocator > > | ViewIds |
| |
| TRefCountPtr< IPooledRenderTarget > | PrevHZB = nullptr |
| |
| bool | bIsEnabled = false |
| |
| EInstanceCullingMode | InstanceCullingMode = EInstanceCullingMode::Normal |
| |
| EInstanceCullingFlags | Flags = EInstanceCullingFlags::None |
| |
| uint32 | TotalInstances = 0U |
| |
| int32 | DynamicInstanceIdOffset = -1 |
| |
| int32 | DynamicInstanceIdNum = -1 |
| |
| SyncPrerequisitesFuncType | SyncPrerequisitesFunc |
| |
| TArray< FMeshDrawCommandInfo, SceneRenderingAllocator > | MeshDrawCommandInfos |
| |
| TArray< FRHIDrawIndexedIndirectParameters, SceneRenderingAllocator > | IndirectArgs |
| |
| TArray< FUintVector2, SceneRenderingAllocator > | DrawCommandDescs |
| |
| TArray< FPayloadData, SceneRenderingAllocator > | PayloadData |
| |
| TArray< uint32, SceneRenderingAllocator > | InstanceIdOffsets |
| |
| TArray< FCompactionData, SceneRenderingAllocator > | DrawCommandCompactionData |
| |
| TArray< uint32, SceneRenderingAllocator > | CompactionBlockDataIndices |
| |
| uint32 | NumCompactionInstances = 0U |
| |
| LoadBalancerArray | LoadBalancers = LoadBalancerArray(InPlace, nullptr) |
| |
| EBatchProcessingMode | SingleInstanceProcessingMode = EBatchProcessingMode::UnCulled |
| |
| FUniformBufferStaticSlot | InstanceCullingStaticSlot |
| |
| bool | bUsesUniformBufferView |
| |
◆ LoadBalancerArray
◆ SyncPrerequisitesFuncType
◆ EAsyncProcessingMode
| Enumerator |
|---|
| DeferredOrAsync | |
| Synchronous | |
◆ EInstanceFlags
| Enumerator |
|---|
| None | |
| DynamicInstanceDataOffset | |
| ForceInstanceCulling | |
| PreserveInstanceOrder | |
◆ FInstanceCullingContext() [1/3]
| FInstanceCullingContext::FInstanceCullingContext |
( |
| ) |
|
|
inline |
◆ FInstanceCullingContext() [2/3]
◆ FInstanceCullingContext() [3/3]
Create an instance culling context to process draw commands that can be culled using GPU-Scene.
- Parameters
-
| InPrevHZB | if non-null enables HZB-occlusion culling for the context (if r.InstanceCulling.OcclusionCull is enabled), NOTE: only one PrevHZB target is allowed accross all passes currently, so either must be atlased or otherwise the same. |
◆ ~FInstanceCullingContext()
| FInstanceCullingContext::~FInstanceCullingContext |
( |
| ) |
|
◆ AddClearIndirectArgInstanceCountPass()
Helper function to add a pass to zero the instance count in the indirect args.
◆ AddInstanceRunsToDrawCommand()
Command that is executed in the per-view, post-cull pass to gather up the instances belonging to this primitive. Multiple commands may add to the same slot, ordering is not preserved.
◆ AddInstancesToDrawCommand() [1/2]
Add command to cull a range of instances for the given mesh draw command index. Multiple commands may add to the same slot, ordering is not preserved.
◆ AddInstancesToDrawCommand() [2/2]
◆ AllocateIndirectArgs()
◆ BeginAsyncSetup()
Set up the context to track an async setup process, or some deferred setup work. The supplied function should do two things, apart from any other processing needed.
- wait for the async setup task
- Call SetDynamicPrimitiveInstanceOffsets (unless that is achieved somehow else).
◆ BuildRenderingCommands() [1/2]
This BuildRenderingCommands operation may be deferred and merged into a global pass when possible. Note: InstanceCullingDrawParams is captured by the deferred culling passes and must therefore have a RDG-lifetime. If BeginAsyncSetup has been called prior to this, the WaitForSetupTask is deferred as long as possible. If BeginAsyncSetup was not called, then SetDynamicPrimitiveInstanceOffsets must be called before this.
◆ BuildRenderingCommands() [2/2]
This version is never deferred, nor async, calling BeginAsyncSetup before this is an error.
◆ BuildRenderingCommandsInternal()
◆ CreateDeferredContext()
Add a batched BuildRenderingCommands pass. Each batch represents a BuildRenderingCommands call from a mesh pass. Batches are collected as we walk through the main render setup and are executed when RDG Execute or Drain is called. This implicitly ends the deferred context, so if Drain is used, it should be paired with a new call to BeginDeferredCulling.
◆ CreateDummyInstanceCullingUniformBuffer()
◆ GetInstanceCullingMode()
◆ GetInstanceIdBufferStride()
◆ GetInstanceIdNumElements()
| uint32 FInstanceCullingContext::GetInstanceIdNumElements |
( |
| ) |
const |
◆ GetStaticUniformBufferSlot()
◆ HasCullingCommands()
| bool FInstanceCullingContext::HasCullingCommands |
( |
| ) |
const |
Returns true if there are any instances in this context needing to be rendered. Must not be called before WaitForSetupTask if BeginAsyncSetup was called.
◆ IsEnabled()
| bool FInstanceCullingContext::IsEnabled |
( |
| ) |
const |
|
inline |
◆ IsGPUCullingEnabled()
| bool FInstanceCullingContext::IsGPUCullingEnabled |
( |
| ) |
|
|
static |
◆ IsInstanceOrderPreservationEnabled()
| bool FInstanceCullingContext::IsInstanceOrderPreservationEnabled |
( |
| ) |
const |
◆ IsOcclusionCullingEnabled()
| bool FInstanceCullingContext::IsOcclusionCullingEnabled |
( |
| ) |
|
|
static |
◆ ResetCommands()
| void FInstanceCullingContext::ResetCommands |
( |
int32 |
MaxNumCommands | ) |
|
Call to empty out the culling commands & other culling data.
◆ SetDeferredContextCullingParams()
◆ SetDynamicPrimitiveInstanceOffsets()
| void FInstanceCullingContext::SetDynamicPrimitiveInstanceOffsets |
( |
int32 |
InDynamicInstanceIdOffset, |
|
|
int32 |
InDynamicInstanceIdNum |
|
) |
| |
◆ SetupDrawCommands()
Allocate indirect arg slots for all meshes to use instancing, add commands that populate the indirect calls and index & id buffers, and Collapse all commands that share the same state bucket ID NOTE: VisibleMeshDrawCommandsInOut can only become shorter.
◆ StepInstanceDataOffsetBytes()
| uint32 FInstanceCullingContext::StepInstanceDataOffsetBytes |
( |
uint32 |
NumStepDraws | ) |
const |
◆ SubmitDrawCommands()
◆ WaitForSetupTask()
| void FInstanceCullingContext::WaitForSetupTask |
( |
| ) |
|
Calls the sync function passed tp BeginAsyncSetup to ensure the setup processing is completed.
◆ bIsEnabled
| bool FInstanceCullingContext::bIsEnabled = false |
◆ bUsesUniformBufferView
| bool FInstanceCullingContext::bUsesUniformBufferView |
◆ CompactionBlockDataIndices
◆ CompactionBlockNumInstances
◆ DrawCommandCompactionData
◆ DrawCommandDescs
◆ DynamicInstanceIdNum
| int32 FInstanceCullingContext::DynamicInstanceIdNum = -1 |
◆ DynamicInstanceIdOffset
| int32 FInstanceCullingContext::DynamicInstanceIdOffset = -1 |
◆ Flags
◆ IndirectArgs
◆ IndirectArgsNumWords
◆ InstanceCullingManager
◆ InstanceCullingMode
◆ InstanceCullingStaticSlot
◆ InstanceIdOffsets
◆ LoadBalancers
◆ MeshDrawCommandInfos
◆ NumCompactionInstances
| uint32 FInstanceCullingContext::NumCompactionInstances = 0U |
◆ PayloadData
◆ PrevHZB
◆ ShaderPlatform
◆ SingleInstanceProcessingMode
◆ SyncPrerequisitesFunc
◆ TotalInstances
| uint32 FInstanceCullingContext::TotalInstances = 0U |
◆ UniformViewInstanceStride
Initial value:=
{
}
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
◆ ViewIds
The documentation for this class was generated from the following files: