r.FASTBuildController.SendAllPossibleShaderDependencies
r.FASTBuildController.SendAllPossibleShaderDependencies
#Overview
name: r.FASTBuildController.SendAllPossibleShaderDependencies
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Send all possible dependencies of the shaders to the remote machines.0: Use dependencies array reported in the task structure.\n1: Brute-force discover all possible dependencies. \n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.FASTBuildController.SendAllPossibleShaderDependencies is to control how shader dependencies are handled when using the FASTBuild controller in Unreal Engine 5. This setting variable is part of the shader compilation and distribution system, specifically for optimizing shader compilation in distributed build environments.
This setting variable is primarily used by the FASTBuildController plugin, which is responsible for managing distributed builds using the FASTBuild system. The plugin is part of Unreal Engine’s build system and is designed to improve build times by distributing compilation tasks across multiple machines.
The value of this variable is set using an FAutoConsoleVariableRef, which allows it to be modified at runtime through the console or configuration files. It is initialized with a default value of 1.
The associated variable SendAllPossibleShaderDependencies directly interacts with r.FASTBuildController.SendAllPossibleShaderDependencies. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable affects how shader dependencies are determined and sent to remote machines during distributed builds. When set to 1 (default), it performs a brute-force discovery of all possible dependencies, which may increase the amount of data sent but ensures all necessary files are available for compilation. When set to 0, it uses only the dependencies reported in the task structure, which may be more efficient but could potentially miss some dependencies.
Best practices when using this variable include:
- Leave it at the default value (1) unless you’re experiencing performance issues with large projects.
- If you choose to set it to 0, carefully monitor your builds to ensure all necessary dependencies are being included.
- Consider the trade-off between build reliability (sending all possible dependencies) and network efficiency (sending only reported dependencies).
Regarding the associated variable SendAllPossibleShaderDependencies:
This is an internal variable used within the FASTBuildController plugin to implement the functionality controlled by r.FASTBuildController.SendAllPossibleShaderDependencies. It is used in the WriteDependenciesForShaderToScript function to determine whether to send all possible dependencies or just the reported ones.
Developers should not directly modify this variable, but instead use the r.FASTBuildController.SendAllPossibleShaderDependencies console variable to control its behavior. The associated variable follows the same best practices and considerations as the main console variable.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/FastBuildController/Source/Private/FastBuildUtilities.cpp:23
Scope (from outer to inner):
file
namespace FASTBuildControllerUtilitiesVariables
Source code excerpt:
int32 SendAllPossibleShaderDependencies = 1;
FAutoConsoleVariableRef CVarFASTBuildSendAllPossibleShaderDependencies(
TEXT("r.FASTBuildController.SendAllPossibleShaderDependencies"),
SendAllPossibleShaderDependencies,
TEXT("Send all possible dependencies of the shaders to the remote machines.")
TEXT("0: Use dependencies array reported in the task structure.\n")
TEXT("1: Brute-force discover all possible dependencies. \n"),
ECVF_Default);
}
#Associated Variable and Callsites
This variable is associated with another variable named SendAllPossibleShaderDependencies
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/FastBuildController/Source/Private/FastBuildUtilities.cpp:21
Scope (from outer to inner):
file
namespace FASTBuildControllerUtilitiesVariables
Source code excerpt:
ECVF_Default);
int32 SendAllPossibleShaderDependencies = 1;
FAutoConsoleVariableRef CVarFASTBuildSendAllPossibleShaderDependencies(
TEXT("r.FASTBuildController.SendAllPossibleShaderDependencies"),
SendAllPossibleShaderDependencies,
TEXT("Send all possible dependencies of the shaders to the remote machines.")
TEXT("0: Use dependencies array reported in the task structure.\n")
TEXT("1: Brute-force discover all possible dependencies. \n"),
ECVF_Default);
}
#Loc: <Workspace>/Engine/Plugins/FastBuildController/Source/Private/FastBuildUtilities.cpp:154
Scope (from outer to inner):
file
function void FastBuildUtilities::WriteDependenciesForShaderToScript
Source code excerpt:
{
TArray<FString> FullUniqueDependenciesArray;
if (FASTBuildControllerUtilitiesVariables::SendAllPossibleShaderDependencies)
{
// This is kinda a hack because we are sending all possible dependencies
FDependencyUniqueArrayEnumerator ShaderUsfDeps = FDependencyUniqueArrayEnumerator(FullUniqueDependenciesArray, nullptr, TEXT(".usf"));
FDependencyUniqueArrayEnumerator ShaderUshDeps = FDependencyUniqueArrayEnumerator(FullUniqueDependenciesArray, nullptr, TEXT(".ush"));
FDependencyUniqueArrayEnumerator ShaderHeaderDeps = FDependencyUniqueArrayEnumerator(FullUniqueDependenciesArray, nullptr, TEXT(".h"));
const TMap<FString, FString> ShaderSourceDirectoryMappings = AllShaderSourceDirectoryMappings();