FNiagaraGPUInstanceCountManager

A manager that handles the buffer containing the GPU particle count.

Windows
MacOS
Linux

References

Module

Niagara

Header

/Engine/Plugins/FX/Niagara/Source/Niagara/Classes/NiagaraGPUInstanceCountManager.h

Include

#include "NiagaraGPUInstanceCountManager.h"

Syntax

class FNiagaraGPUInstanceCountManager

Remarks

A manager that handles the buffer containing the GPU particle count. Also provides related functionalities like the generation of the draw indirect buffer.

Variables

Name Description

Protected variable

int32

 

AllocatedCulledCounts

The allocated instance counts in the culled count buffer

Protected variable

int32

 

AllocatedInstanceCounts

The allocated instance counts in CountBuffer

Protected variable

bool

 

bAcquiredCulledCounts

Whether or not the culled counts were acquired this frame

Protected variable

FRWBuffer

 

CountBuffer

A buffer holding the each emitter particle count after a simulation tick.

Protected variable

FRHIGPUMemoryRe...

 

CountReadback

Protected variable

int32

 

CountReadbackSize

Protected variable

FRWBuffer

 

CulledCountBuffer

Protected variable

TArray< FArgGen...

 

DrawIndirectArgGenTasks

Protected variable

TMap< FArgGenTa...

 

DrawIndirectArgMap

The map between each task FArgGenTaskInfo and entry offset from DrawIndirectArgGenTasks.

Protected variable

uint32

 

DrawIndirectLowWaterFrames

Protected variable

TArray< FIndire...

 

DrawIndirectPool

Buffers holding drawindirect data to render GPU emitter renderers.

Protected variable

TArray< uint32 ...

 

FreeEntries

Protected variable

TArray< uint32 ...

 

InstanceCountClearTasks

The list of all instance count clear tasks that are to be run in UpdateDrawIndirectBuffers()

Protected variable

int32

 

RequiredCulledCounts

The number of culled instance counts needed from view culling

Protected variable

int32

 

UsedInstanceCounts

The current used instance counts allocated from FNiagaraDataBuffer::AllocateGPU()

Constructors

Destructors

Functions

Name Description

Public function

FRWBuffer &#...

 

AcquireCulledCountsBuffer

(
    FRHICommandListImmediate& RHICmdLi...,
    ERHIFeatureLevel::Type FeatureLevel
)

Public function

uint32

 

AcquireCulledEntry()

Public function

uint32

 

AcquireEntry()

Public function

FIndirectArg...

 

AddDrawIndirect

(
    uint32 InstanceCountBufferOffset,
    uint32 NumIndicesPerInstance,
    uint32 StartIndexLocation,
    bool bIsInstancedStereoEnabled,
    bool bCulled
)

Add a draw indirect task to generate the draw indirect args.

Public function

void

 

EnqueueGPUReadback

(
    FRHICommandListImmediate& RHICmdLi...
)

Public function

void

 

FlushIndirectArgsPool()

Public function

void

 

FreeEntry

(
    uint32& BufferOffset
)

Free the entry and reset it to INDEX_NONE if valid.

Public function

void

 

FreeEntryArray

(
    TConstArrayView< uint32 > EntryArra...
)

Free and array of entries, you are expected to reset or change to INDEX_NONE.

Public function

const uint32...

 

GetGPUReadback()

Public function

FRWBuffer &

 

GetInstanceCountBuffer()

Public function Const

bool

 

HasEntriesPendingFree()

Public function Const

bool

 

HasPendingGPUReadback()

Public function

void

 

InitRHI()

Init resource for the first time.

Protected function

void

 

ReleaseCounts()

Public function

void

 

ReleaseGPUReadback()

Public function

void

 

ReleaseRHI()

Free resources.

Public function

void

 

ResizeBuffers

(
    FRHICommandListImmediate& RHICmdLi...,
    ERHIFeatureLevel::Type FeatureLevel,
    int32 ReservedInstanceCounts
)

Resize instance count and draw indirect buffers to ensure it is big enough to hold all draw indirect args.

Public function

void

 

UpdateDrawIndirectBuffers

(
    NiagaraEmitterInstanceBatcher& Bat...,
    FRHICommandList& RHICmdList,
    ERHIFeatureLevel::Type FeatureLevel
)

Generate the draw indirect buffers, and reset all release counts.

Classes

Typedefs

Name

Description

FArgGenSlotInfo

FArgGenTaskInfo

The list of all draw indirected tasks that are to be run in UpdateDrawIndirectBuffers()

FIndirectArgsPoolEntryPtr

Constants

Name

Description

kCountBufferDefaultState

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss