r.ParallelGeometryCollectionBatchSize
r.ParallelGeometryCollectionBatchSize
#Overview
name: r.ParallelGeometryCollectionBatchSize
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The number of vertices per thread dispatch in a single collection. \n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.ParallelGeometryCollectionBatchSize is to control the number of vertices processed per thread dispatch in a single geometry collection. This setting is primarily used in the rendering system, specifically for parallel processing of geometry collections.
This setting variable is utilized in the Experimental GeometryCollectionEngine module of Unreal Engine 5. It’s particularly relevant to the GeometryCollectionSceneProxy component, which is responsible for rendering geometry collections.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1024 vertices per batch, but can be modified at runtime through console commands or configuration files.
The associated variable CVarParallelGeometryCollectionBatchSize interacts directly with r.ParallelGeometryCollectionBatchSize. It’s used to retrieve the current value of the setting in the render thread.
Developers should be aware that this variable affects the parallelization of geometry collection processing. A larger batch size may reduce overhead but could potentially lead to less even distribution of work across threads. Conversely, a smaller batch size might increase parallelism but at the cost of more overhead.
Best practices when using this variable include:
- Experimenting with different batch sizes to find the optimal balance between parallelism and overhead for your specific use case.
- Monitoring performance metrics when adjusting this value to ensure it’s improving rather than degrading performance.
- Being cautious about setting extremely large or small values, as they might negatively impact performance or memory usage.
Regarding the associated variable CVarParallelGeometryCollectionBatchSize:
The purpose of CVarParallelGeometryCollectionBatchSize is to provide a runtime-configurable interface for the r.ParallelGeometryCollectionBatchSize setting. It allows the engine to access and modify the batch size value during execution.
This variable is part of the console variable system in Unreal Engine, which is used across various subsystems for configuration and debugging purposes.
The value of CVarParallelGeometryCollectionBatchSize is set when the engine initializes the console variable system, and it can be modified at runtime through console commands.
It interacts directly with the r.ParallelGeometryCollectionBatchSize setting, effectively serving as its runtime representation.
Developers should be aware that changes to CVarParallelGeometryCollectionBatchSize will directly affect the behavior of geometry collection processing in the render thread.
Best practices for using CVarParallelGeometryCollectionBatchSize include:
- Using it for runtime adjustments and performance tuning.
- Logging or displaying its value when debugging performance issues related to geometry collections.
- Considering its impact on different hardware configurations, as optimal values may vary across different systems.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionSceneProxy.cpp:54
Scope: file
Source code excerpt:
static int32 GParallelGeometryCollectionBatchSize = 1024;
static TAutoConsoleVariable<int32> CVarParallelGeometryCollectionBatchSize(
TEXT("r.ParallelGeometryCollectionBatchSize"),
GParallelGeometryCollectionBatchSize,
TEXT("The number of vertices per thread dispatch in a single collection. \n"),
ECVF_Default
);
static int32 GGeometryCollectionTripleBufferUploads = 1;
#Associated Variable and Callsites
This variable is associated with another variable named CVarParallelGeometryCollectionBatchSize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionSceneProxy.cpp:53
Scope: file
Source code excerpt:
static int32 GParallelGeometryCollectionBatchSize = 1024;
static TAutoConsoleVariable<int32> CVarParallelGeometryCollectionBatchSize(
TEXT("r.ParallelGeometryCollectionBatchSize"),
GParallelGeometryCollectionBatchSize,
TEXT("The number of vertices per thread dispatch in a single collection. \n"),
ECVF_Default
);
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionSceneProxy.cpp:525
Scope (from outer to inner):
file
function void FGeometryCollectionSceneProxy::UpdateSkinnedPositions
Source code excerpt:
bool bParallelGeometryCollection = true;
int32 ParallelGeometryCollectionBatchSize = CVarParallelGeometryCollectionBatchSize.GetValueOnRenderThread();
int32 NumBatches = (VertexCount / ParallelGeometryCollectionBatchSize);
if (VertexCount != ParallelGeometryCollectionBatchSize)
{
NumBatches++;