OpenColorIO.NoShaderDDC
OpenColorIO.NoShaderDDC
#Overview
name: OpenColorIO.NoShaderDDC
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When enabled, we don\'t check the DDC for compiled shaders to simulate a cold DDC.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of OpenColorIO.NoShaderDDC is to control whether the Derived Data Cache (DDC) is checked for compiled shaders in the OpenColorIO plugin. This setting is primarily used for debugging and performance testing purposes.
This setting variable is used in the OpenColorIO plugin, which is part of Unreal Engine’s compositing system. It specifically affects the shader compilation and caching process for OpenColorIO-related shaders.
The value of this variable is set through a console variable (CVar) named CVarShowOpenColorIONoShaderDDC. It’s initialized as false by default, meaning that the DDC is checked for compiled shaders under normal circumstances.
The associated variable CVarShowOpenColorIONoShaderDDC directly interacts with OpenColorIO.NoShaderDDC. They share the same value and purpose.
Developers must be aware that enabling this variable (setting it to true) will prevent the engine from checking the DDC for compiled shaders. This simulates a “cold” DDC, which can be useful for testing shader compilation performance or debugging issues related to shader caching.
Best practices when using this variable include:
- Only enable it for debugging or performance testing purposes.
- Be aware that enabling it may increase load times and shader compilation times, as shaders will need to be recompiled instead of being loaded from the cache.
- Remember to disable it after testing to ensure normal performance in production builds.
Regarding the associated variable CVarShowOpenColorIONoShaderDDC:
- It’s a TAutoConsoleVariable
type, which means it can be changed at runtime through the console. - It’s used in the FOpenColorIOShaderMap::LoadFromDerivedDataCache function to determine whether to skip loading shaders from the DDC.
- It’s checked using the GetValueOnAnyThread() method, which suggests it can be accessed from multiple threads.
When working with this variable, developers should consider the impact on shader compilation times and overall performance, especially in development and debugging scenarios.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Compositing/OpenColorIO/Source/OpenColorIO/Private/OpenColorIOShaderMap.cpp:39
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarShowOpenColorIONoShaderDDC(
TEXT("OpenColorIO.NoShaderDDC"),
false,
TEXT("When enabled, we don't check the DDC for compiled shaders to simulate a cold DDC.")
);
//
// Globals
#Associated Variable and Callsites
This variable is associated with another variable named CVarShowOpenColorIONoShaderDDC
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Compositing/OpenColorIO/Source/OpenColorIO/Private/OpenColorIOShaderMap.cpp:38
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarShowOpenColorIONoShaderDDC(
TEXT("OpenColorIO.NoShaderDDC"),
false,
TEXT("When enabled, we don't check the DDC for compiled shaders to simulate a cold DDC.")
);
//
#Loc: <Workspace>/Engine/Plugins/Compositing/OpenColorIO/Source/OpenColorIO/Private/OpenColorIOShaderMap.cpp:261
Scope (from outer to inner):
file
function void FOpenColorIOShaderMap::LoadFromDerivedDataCache
Source code excerpt:
static bool bNoShaderDDC = FParse::Param(FCommandLine::Get(), TEXT("noshaderddc"));
if (bNoShaderDDC || CVarShowOpenColorIONoShaderDDC.GetValueOnAnyThread())
{
return;
}
// Shader map was not found in memory, try to load it from the DDC
STAT(double OpenColorIOShaderDDCTime = 0);