Navigation
API > API/Plugins > API/Plugins/Niagara
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
| Type | Name | Description | |
|---|---|---|---|
| int32 | AllocatedCulledCounts | The allocated instance counts in the culled count buffer | |
| int32 | AllocatedInstanceCounts | The allocated instance counts in CountBuffer | |
| bool | bAcquiredCulledCounts | Whether or not the culled counts were acquired this frame | |
| FRWBuffer | CountBuffer | A buffer holding the each emitter particle count after a simulation tick. | |
| FRHIGPUMemoryReadback * | CountReadback | ||
| int32 | CountReadbackSize | ||
| FRWBuffer | CulledCountBuffer | ||
| ERHIAccess | CulledCountsRHIAccess | Used to track RHI access for the culled counts buffer. | |
| TArray< FNiagaraDrawIndirectArgGenTaskInfo >[ENiagaraGPUCountUpdatePhase::Max] | DrawIndirectArgGenTasks | The list of all draw indirected tasks that are to be run in UpdateDrawIndirectBuffers() | |
| TMap< FNiagaraDrawIndirectArgGenTaskInfo, FNiagaraDrawIndirectArgGenSlotInfo > | DrawIndirectArgMap | ||
| uint32 | DrawIndirectLowWaterFrames | ||
| TArray< FIndirectArgsPoolEntryPtr > | DrawIndirectPool | Buffers holding drawindirect data to render GPU emitter renderers. | |
| ERHIFeatureLevel::Type | FeatureLevel | ||
| TArray< uint32 > | FreeEntries | ||
| TArray< uint32 > | InstanceCountClearTasks | The list of all instance count clear tasks that are to be run in UpdateDrawIndirectBuffers() | |
| int32 | MultiViewAllocatedInstanceCounts | Mirrored copy of CountBuffer for multi-view rendering. | |
| FRWBuffer | MultiViewCountBuffer | ||
| int32 | RequiredCulledCounts | The number of culled instance counts needed from view culling | |
| int32 | UsedInstanceCounts | The current used instance counts allocated from FNiagaraDataBuffer::AllocateGPU() |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FNiagaraGPUInstanceCountManager
(
ERHIFeatureLevel::Type FeatureLevel |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| FRWBuffer * | AcquireCulledCountsBuffer
(
FRHICommandListImmediate& RHICmdList |
||
| uint32 | |||
| uint32 | AcquireEntry () |
Acquire an entry from the free list, assumes this comes from being presized. | |
| uint32 | AcquireOrAllocateEntry
(
FRHICommandListImmediate& RHICmdList |
Acquire an entry, this will either come from the free list or reallocate the buffer. | |
| FIndirectArgSlot | AddDrawIndirect
(
FRHICommandListBase& RHICmdList, |
Add a draw indirect task to generate the draw indirect args. | |
| bool | |||
| void | CopyToMultiViewCountBuffer
(
FRHICommandListImmediate& RHICmdList |
||
| void | EnqueueGPUReadback
(
FRHICommandListImmediate& RHICmdList |
||
| void | FlushIndirectArgsPool
(
FRHICommandListBase& RHICmdList |
||
| void | FreeEntry
(
uint32& BufferOffset |
Free the entry and reset it to INDEX_NONE if valid. | |
| void | FreeEntryArray
(
TConstArrayView< uint32 > EntryArray |
Free and array of entries, you are expected to reset or change to INDEX_NONE. | |
| const uint32 * | |||
| const FRWBuffer & | |||
| bool | |||
| bool | |||
| void | InitRHI
(
FRHICommandListBase& RHICmdList |
Init resource for the first time. | |
| void | |||
| void | |||
| void | ReleaseRHI () |
Free resources. | |
| void | ResizeBuffers
(
FRHICommandListImmediate& RHICmdList, |
Resize instance count and draw indirect buffers to ensure it is big enough to hold all draw indirect args. | |
| void | UpdateDrawIndirectBuffers
(
FNiagaraGpuComputeDispatchInterface* ComputeDispatchInterface, |
Generate the draw indirect buffers, and reset all release counts. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FIndirectArgSlot | |||
| FIndirectArgsPoolEntry | |||
| FNiagaraDrawIndirectArgGenSlotInfo | Set to allow de-duplication of FNiagaraDrawIndirectArgGenTaskInfo. |
Typedefs
| Name | Description |
|---|---|
| FIndirectArgsPoolEntryPtr |
Constants
| Name | Description |
|---|---|
| kCountBufferDefaultState | |
| kIndirectArgsDefaultState |