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

 

AllocatedDrawIndirectArgs

The allocated indirect args in DrawIndirectBuffer (each being 5 uint32)

Protected variable

int32

 

AllocatedInstanceCounts

The allocated instance counts in CountBuffer

Protected variable

float

 

BufferSlack

Buffer slack size hysteresis used to managed the size of CountBuffer and DrawIndirectBuffer.

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

TArray< FArgGen...

 

DrawIndirectArgGenTasks

Protected variable

TMap< FArgGenTa...

 

DrawIndirectArgMap

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

Protected variable

FRWBuffer

 

DrawIndirectBuffer

A buffer 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 UpdateDrawIndirectBuffer()

Protected variable

TRefCountPtr< F...

 

NumRegisteredGPURenderers

The number of GPU renderer. It defines the max possible required draw indirect args count

Protected variable

int32

 

UsedInstanceCounts

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

Constructors

Destructors

Functions

Name Description

Public function

uint32

 

AcquireEntry()

Public function

uint32

 

AddDrawIndirect

(
    uint32 InstanceCountBufferOffset,
    uint32 NumIndicesPerInstance,
    uint32 StartIndexLocation
)

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

Public function

void

 

EnqueueGPUReadback

(
    FRHICommandListImmediate& RHICmdLi...
)

Public function

void

 

FreeEntry

(
    uint32& BufferOffset
)

Free the entry and reset it to INDEX_NONE if valid.

Public function

FRWBuffer &

 

GetDrawIndirectBuffer()

Public function

const uint32...

 

GetGPUReadback()

Public function

const TRefCo...

 

GetGPURendererCount()

Update the max possible required draw indirect args (one per renderer).

Public function

FRWBuffer &

 

GetInstanceCountBuffer()

Public function Const

bool

 

HasPendingGPUReadback()

Public function

void

 

InitRHI()

Init resource for the first time.

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

 

UpdateDrawIndirectBuffer

(
    FRHICommandList& RHICmdList,
    ERHIFeatureLevel::Type FeatureLevel
)

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

Typedefs

Name

Description

FArgGenTaskInfo

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

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