r.PSOPrecache.DitheredLODFadingOutMaskPass
r.PSOPrecache.DitheredLODFadingOutMaskPass
#Overview
name: r.PSOPrecache.DitheredLODFadingOutMaskPass
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Precache PSOs for DitheredLODFadingOutMaskPass.\n 0: No PSOs are compiled for this pass (default).\n 1: PSOs are compiled for all primitives which render to depth pass.\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.PSOPrecache.DitheredLODFadingOutMaskPass is to control the precaching of Pipeline State Objects (PSOs) for the DitheredLODFadingOutMaskPass in Unreal Engine 5’s rendering system.
This setting variable is primarily used by the rendering system, specifically in the depth rendering module. It’s part of the PSO precaching optimization system, which aims to improve rendering performance by precompiling shader pipelines.
The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with an initial value of 0, meaning by default, no PSOs are compiled for this pass.
The associated variable CVarPSOPrecacheDitheredLODFadingOutMaskPass directly interacts with it. They share the same value and purpose.
Developers must be aware that:
- This variable is read-only (ECVF_ReadOnly), meaning it cannot be changed at runtime.
- It has two possible values: 0 (default, no PSO precaching) and 1 (PSO precaching enabled for all primitives rendering to depth pass).
- Changing this value can affect rendering performance and initial load times.
Best practices when using this variable include:
- Only enable PSO precaching (set to 1) if you’re experiencing performance issues related to shader compilation during the DitheredLODFadingOutMaskPass.
- Be aware that enabling precaching may increase initial load times but could improve runtime performance.
- Test thoroughly with both settings to determine the best option for your specific use case.
Regarding the associated variable CVarPSOPrecacheDitheredLODFadingOutMaskPass:
- Its purpose is identical to r.PSOPrecache.DitheredLODFadingOutMaskPass.
- It’s used in the FDepthPassMeshProcessor::CollectPSOInitializers function to determine whether to proceed with PSO initialization for the DitheredLODFadingOutMaskPass.
- The value is checked using GetValueOnAnyThread(), indicating it can be accessed from multiple threads.
- Developers should treat this variable the same as r.PSOPrecache.DitheredLODFadingOutMaskPass, 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/DepthRendering.cpp:75
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarPSOPrecacheDitheredLODFadingOutMaskPass(
TEXT("r.PSOPrecache.DitheredLODFadingOutMaskPass"),
0,
TEXT("Precache PSOs for DitheredLODFadingOutMaskPass.\n") \
TEXT(" 0: No PSOs are compiled for this pass (default).\n") \
TEXT(" 1: PSOs are compiled for all primitives which render to depth pass.\n"),
ECVF_ReadOnly
);
#Associated Variable and Callsites
This variable is associated with another variable named CVarPSOPrecacheDitheredLODFadingOutMaskPass
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DepthRendering.cpp:74
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe | ECVF_ReadOnly);
static TAutoConsoleVariable<int32> CVarPSOPrecacheDitheredLODFadingOutMaskPass(
TEXT("r.PSOPrecache.DitheredLODFadingOutMaskPass"),
0,
TEXT("Precache PSOs for DitheredLODFadingOutMaskPass.\n") \
TEXT(" 0: No PSOs are compiled for this pass (default).\n") \
TEXT(" 1: PSOs are compiled for all primitives which render to depth pass.\n"),
ECVF_ReadOnly
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DepthRendering.cpp:1103
Scope (from outer to inner):
file
function void FDepthPassMeshProcessor::CollectPSOInitializers
Source code excerpt:
// PSO precaching enabled for DitheredLODFadingOutMaskPass
if (MeshPassType == EMeshPass::DitheredLODFadingOutMaskPass && CVarPSOPrecacheDitheredLODFadingOutMaskPass.GetValueOnAnyThread() == 0)
{
return;
}
const bool bIsTranslucent = IsTranslucentBlendMode(Material);