fx.ParticleManagerAsyncBatchSize
fx.ParticleManagerAsyncBatchSize
#Overview
name: fx.ParticleManagerAsyncBatchSize
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
How many PSCs the ParticleWorldManager should tick per async task.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of fx.ParticleManagerAsyncBatchSize is to control the number of Particle System Components (PSCs) that the ParticleWorldManager should process in a single asynchronous task. This setting variable is part of the particle system management in Unreal Engine’s rendering system.
The Unreal Engine subsystem that relies on this setting variable is the Particle System Manager, which is part of the Engine module. This can be seen from the file path where the variable is defined and used: Engine/Source/Runtime/Engine/Private/Particles/ParticleSystemManager.cpp.
The value of this variable is set through the console variable system. It’s initialized with a default value of INITIAL_PSC_MANAGER_ASYNC_BATCH_SIZE and can be changed at runtime using console commands.
The associated variable GParticleManagerAsyncBatchSize directly interacts with fx.ParticleManagerAsyncBatchSize. They share the same value, with GParticleManagerAsyncBatchSize being the actual variable used in the C++ code, while fx.ParticleManagerAsyncBatchSize is the console variable name used for external access and configuration.
Developers must be aware that this variable affects the performance and scalability of particle systems. A larger batch size may improve performance by reducing overhead, but it could also lead to longer individual task durations. Conversely, a smaller batch size might provide more even distribution of work but could increase overall overhead.
Best practices when using this variable include:
- Profiling the particle system performance with different batch sizes to find the optimal value for your specific use case.
- Considering the target hardware when setting this value, as different platforms may benefit from different batch sizes.
- Being cautious about setting extremely large values, as this could lead to frame rate hitches if a single async task takes too long to complete.
- Using the console variable system to experiment with different values during development and testing.
Regarding the associated variable GParticleManagerAsyncBatchSize:
- Its purpose is to serve as the actual integer value used in the C++ code to control the batch size.
- It’s used directly in the ParticleSystemManager to determine when to flush async ticks.
- The value is set through the console variable system, linked to fx.ParticleManagerAsyncBatchSize.
- It interacts with the AsyncTickBatch container in the FParticleSystemWorldManager class.
- Developers should be aware that changes to this variable will directly affect the behavior of the particle system manager.
- Best practices include using this variable in conjunction with profiling tools to optimize particle system performance, and considering its impact on both CPU and GPU utilization.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleSystemManager.cpp:30
Scope: file
Source code excerpt:
int32 GParticleManagerAsyncBatchSize = INITIAL_PSC_MANAGER_ASYNC_BATCH_SIZE;
FAutoConsoleVariableRef CVarParticleManagerAsyncBatchSize(
TEXT("fx.ParticleManagerAsyncBatchSize"),
GParticleManagerAsyncBatchSize,
TEXT("How many PSCs the ParticleWorldManager should tick per async task."),
ECVF_Scalability
);
//////////////////////////////////////////////////////////////////////////
#Associated Variable and Callsites
This variable is associated with another variable named GParticleManagerAsyncBatchSize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleSystemManager.cpp:28
Scope: file
Source code excerpt:
);
int32 GParticleManagerAsyncBatchSize = INITIAL_PSC_MANAGER_ASYNC_BATCH_SIZE;
FAutoConsoleVariableRef CVarParticleManagerAsyncBatchSize(
TEXT("fx.ParticleManagerAsyncBatchSize"),
GParticleManagerAsyncBatchSize,
TEXT("How many PSCs the ParticleWorldManager should tick per async task."),
ECVF_Scalability
);
//////////////////////////////////////////////////////////////////////////
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleSystemManager.cpp:559
Scope (from outer to inner):
file
function void FParticleSystemWorldManager::QueueAsyncTick
Source code excerpt:
{
AsyncTickBatch.Add(Handle);
if (AsyncTickBatch.Num() == GParticleManagerAsyncBatchSize)
{
FlushAsyncTicks(TickGroupCompletionGraphEvent);
}
}
void FParticleSystemWorldManager::BuildTickLists(int32 StartIndex, ETickingGroup CurrTickGroup)