r.MeshCardRepresentation.ParallelBuild
r.MeshCardRepresentation.ParallelBuild
#Overview
name: r.MeshCardRepresentation.ParallelBuild
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to use task for mesh card building.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.MeshCardRepresentation.ParallelBuild is to control whether mesh card building should be performed in parallel using tasks or in a single-threaded manner. This setting is primarily related to the mesh card representation system, which is used in Unreal Engine’s rendering pipeline, specifically for Lumen global illumination.
The Unreal Engine subsystem that relies on this setting variable is the MeshUtilities module, particularly the mesh card generation system used for Lumen global illumination.
The value of this variable is set through the console variable system. It’s defined as a TAutoConsoleVariable with a default value of 1, meaning parallel building is enabled by default.
This variable interacts with the associated variable CVarCardRepresentationParallelBuild. They share the same value and purpose.
Developers must be aware that changing this variable will affect the performance and potentially the output of mesh card generation. Setting it to 0 will force single-threaded execution, which may be useful for debugging or on systems where parallel execution causes issues.
Best practices when using this variable include:
- Leave it at the default value (1) for optimal performance on most systems.
- Consider setting it to 0 if you encounter issues related to mesh card generation or need to debug the process.
- Be aware that changing this value may impact build times for mesh cards.
Regarding the associated variable CVarCardRepresentation.ParallelBuild:
The purpose of CVarCardRepresentation.ParallelBuild is identical to r.MeshCardRepresentation.ParallelBuild. It’s the actual console variable implementation that controls the parallel build setting.
This variable is used directly in the MeshUtilities module to determine whether to use parallel or single-threaded mesh card building.
The value is set when the console variable is initialized, with a default value of 1.
It interacts directly with the mesh card generation process, specifically in the InitClusteringParams function where it determines whether to set the bSingleThreadedBuild flag.
Developers should be aware that this variable is accessed using the GetValueOnAnyThread() method, which means its value can be safely read from any thread.
Best practices for using this variable are the same as for r.MeshCardRepresentation.ParallelBuild, as they are essentially the same setting with different access methods.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Developer/MeshUtilities/Private/MeshCardRepresentationUtilities.cpp:16
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarCardRepresentationParallelBuild(
TEXT("r.MeshCardRepresentation.ParallelBuild"),
1,
TEXT("Whether to use task for mesh card building."),
ECVF_Scalability);
namespace MeshCardGen
{
#Associated Variable and Callsites
This variable is associated with another variable named CVarCardRepresentationParallelBuild
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Developer/MeshUtilities/Private/MeshCardRepresentationUtilities.cpp:15
Scope: file
Source code excerpt:
#include <cmath>
static TAutoConsoleVariable<int32> CVarCardRepresentationParallelBuild(
TEXT("r.MeshCardRepresentation.ParallelBuild"),
1,
TEXT("Whether to use task for mesh card building."),
ECVF_Scalability);
namespace MeshCardGen
#Loc: <Workspace>/Engine/Source/Developer/MeshUtilities/Private/MeshCardRepresentationUtilities.cpp:641
Scope (from outer to inner):
file
function void InitClusteringParams
Source code excerpt:
ClusteringParams.MaxLumenMeshCards = MaxLumenMeshCards;
ClusteringParams.bDebug = MeshCardRepresentation::IsDebugMode();
ClusteringParams.bSingleThreadedBuild = CVarCardRepresentationParallelBuild.GetValueOnAnyThread() == 0;
}
void InitSurfelScene(
const FGenerateCardMeshContext& Context,
const FBox& MeshCardsBounds,
int32 MaxLumenMeshCards,