r.PSOPrecache.TranslucencyAllPass
r.PSOPrecache.TranslucencyAllPass
#Overview
name: r.PSOPrecache.TranslucencyAllPass
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Precache PSOs for TranslucencyAll pass.\n 0: No PSOs are compiled for this pass (default).\n 1: PSOs are compiled for all primitives which render to a translucency pass.\n
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.PSOPrecache.TranslucencyAllPass is to control the precaching of Pipeline State Objects (PSOs) for the TranslucencyAll pass in Unreal Engine’s rendering system.
This setting variable is primarily used by the rendering system, specifically for the TranslucencyAll pass, which is part of Unreal Engine’s translucency rendering pipeline.
Based on the Callsites section, this variable is relied upon by the Renderer module, particularly in the BasePassRendering and MobileBasePass components.
The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with a default value of 0, which means by default, no PSOs are compiled for the TranslucencyAll pass.
The associated variable CVarPSOPrecacheTranslucencyAllPass interacts directly with r.PSOPrecache.TranslucencyAllPass. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable is marked as ECVF_ReadOnly, meaning its value should not be changed at runtime. It’s intended to be set before the engine initializes or through configuration files.
Best practices when using this variable include:
- Only enable it (set to 1) if you need to optimize performance for scenes with heavy use of translucency.
- Be aware that enabling this will increase memory usage and potentially increase load times, as more PSOs will be compiled and cached.
- Use it in conjunction with other PSO precaching settings for a comprehensive optimization strategy.
Regarding the associated variable CVarPSOPrecacheTranslucencyAllPass:
Its purpose is identical to r.PSOPrecache.TranslucencyAllPass, serving as the actual console variable implementation.
It’s used in the same Renderer module, specifically in the BasePassRendering component.
The value is set when the console variable is defined, with a default of 0.
It interacts directly with r.PSOPrecache.TranslucencyAllPass, effectively being the same variable.
Developers should be aware that this is the actual variable that’s checked in the code (e.g., CVarPSOPrecacheTranslucencyAllPass.GetValueOnAnyThread()).
Best practices for CVarPSOPrecacheTranslucencyAllPass are the same as for r.PSOPrecache.TranslucencyAllPass, as they are effectively the same setting.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/BasePassRendering.cpp:104
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarPSOPrecacheTranslucencyAllPass(
TEXT("r.PSOPrecache.TranslucencyAllPass"),
0,
TEXT("Precache PSOs for TranslucencyAll pass.\n") \
TEXT(" 0: No PSOs are compiled for this pass (default).\n") \
TEXT(" 1: PSOs are compiled for all primitives which render to a translucency pass.\n"),
ECVF_ReadOnly
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/MobileBasePass.cpp:1055
Scope (from outer to inner):
file
function void FMobileBasePassMeshProcessor::CollectPSOInitializers
Source code excerpt:
void FMobileBasePassMeshProcessor::CollectPSOInitializers(const FSceneTexturesConfig& SceneTexturesConfig, const FMaterial& Material, const FPSOPrecacheVertexFactoryData& VertexFactoryData, const FPSOPrecacheParams& PreCacheParams, TArray<FPSOPrecacheData>& PSOInitializers)
{
static IConsoleVariable* PSOPrecacheTranslucencyAllPass = IConsoleManager::Get().FindConsoleVariable(TEXT("r.PSOPrecache.TranslucencyAllPass"));
// PSO precaching enabled for TranslucencyAll
if (MeshPassType == EMeshPass::TranslucencyAll && PSOPrecacheTranslucencyAllPass->GetInt() == 0)
{
return;
}
#Associated Variable and Callsites
This variable is associated with another variable named CVarPSOPrecacheTranslucencyAllPass
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/BasePassRendering.cpp:103
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarPSOPrecacheTranslucencyAllPass(
TEXT("r.PSOPrecache.TranslucencyAllPass"),
0,
TEXT("Precache PSOs for TranslucencyAll pass.\n") \
TEXT(" 0: No PSOs are compiled for this pass (default).\n") \
TEXT(" 1: PSOs are compiled for all primitives which render to a translucency pass.\n"),
ECVF_ReadOnly
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/BasePassRendering.cpp:2361
Scope (from outer to inner):
file
function void FBasePassMeshProcessor::CollectPSOInitializers
Source code excerpt:
// PSO precaching enabled for TranslucencyAll
if (MeshPassType == EMeshPass::TranslucencyAll && CVarPSOPrecacheTranslucencyAllPass.GetValueOnAnyThread() == 0)
{
return;
}
// Determine the mesh's material and blend mode.
const FMeshDrawingPolicyOverrideSettings OverrideSettings = ComputeMeshOverrideSettings(PreCacheParams);