r.DistanceFields.ParallelUpdate
r.DistanceFields.ParallelUpdate
#Overview
name: r.DistanceFields.ParallelUpdate
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.DistanceFields.ParallelUpdate is to control whether distance field updates are executed in parallel. This setting is part of Unreal Engine’s rendering system, specifically related to distance field calculations.
This setting variable is primarily used in the Renderer module of Unreal Engine, as evidenced by its location in the DistanceFieldObjectManagement.cpp file within the Runtime/Renderer/Private directory.
The value of this variable is set through the console variable system in Unreal Engine. It’s defined as an FAutoConsoleVariableRef, which means it can be changed at runtime through console commands or configuration files.
The r.DistanceFields.ParallelUpdate variable interacts directly with the GDFParallelUpdate variable. They share the same value, with GDFParallelUpdate being the actual integer variable used in the code logic.
Developers must be aware that this variable affects the performance and behavior of distance field calculations. When enabled (set to a non-zero value), it allows for parallel execution of distance field updates, which can potentially improve performance on multi-core systems.
Best practices when using this variable include:
- Testing the performance impact with and without parallel updates enabled for your specific use case.
- Considering the target hardware when deciding whether to enable parallel updates.
- Being cautious when changing this setting at runtime, as it may affect frame rates and overall rendering performance.
Regarding the associated variable GDFParallelUpdate:
The purpose of GDFParallelUpdate is to serve as the actual integer variable that stores the value of r.DistanceFields.ParallelUpdate. It’s used directly in the code logic to determine whether parallel updates should be performed.
This variable is used in the Renderer module, specifically in the distance field object management system.
The value of GDFParallelUpdate is set indirectly through the r.DistanceFields.ParallelUpdate console variable.
GDFParallelUpdate interacts directly with the r.DistanceFields.ParallelUpdate console variable, as they share the same value.
Developers should be aware that changing GDFParallelUpdate directly in code is not recommended, as it should be controlled through the console variable system for consistency and proper engine integration.
Best practices for GDFParallelUpdate include:
- Avoiding direct manipulation of this variable in code.
- Using the r.DistanceFields.ParallelUpdate console variable to control its value.
- Considering the performance implications when enabling or disabling parallel updates in different scenarios or on different hardware configurations.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DistanceFieldObjectManagement.cpp:37
Scope: file
Source code excerpt:
int32 GDFParallelUpdate = 0;
FAutoConsoleVariableRef CVarDFParallelUpdate(
TEXT("r.DistanceFields.ParallelUpdate"),
GDFParallelUpdate,
TEXT(""),
ECVF_RenderThreadSafe
);
int32 GDFReverseAtlasAllocationOrder = 0;
#Associated Variable and Callsites
This variable is associated with another variable named GDFParallelUpdate
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DistanceFieldObjectManagement.cpp:35
Scope: file
Source code excerpt:
);
int32 GDFParallelUpdate = 0;
FAutoConsoleVariableRef CVarDFParallelUpdate(
TEXT("r.DistanceFields.ParallelUpdate"),
GDFParallelUpdate,
TEXT(""),
ECVF_RenderThreadSafe
);
int32 GDFReverseAtlasAllocationOrder = 0;
FAutoConsoleVariableRef CVarDFReverseAtlasAllocationOrder(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DistanceFieldObjectManagement.cpp:491
Scope (from outer to inner):
file
function void FDistanceFieldSceneData::UpdateDistanceFieldObjectBuffers
Source code excerpt:
check(GraphBuilder.RHICmdList.GetGPUMask() == FRHIGPUMask::All());
const bool bExecuteInParallel = GDFParallelUpdate != 0 && FApp::ShouldUseThreadingForPerformance();
if (HasPendingOperations() || HasPendingUploads())
{
QUICK_SCOPE_CYCLE_COUNTER(STAT_UpdateDistanceFieldObjectBuffers);
RDG_EVENT_SCOPE(GraphBuilder, "UpdateDistanceFieldObjectBuffers");