bPromptToRetryFailedShaderCompiles
bPromptToRetryFailedShaderCompiles
#Overview
name: bPromptToRetryFailedShaderCompiles
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bPromptToRetryFailedShaderCompiles is to control whether the Unreal Engine should prompt the user to retry shader compilations that have failed. This variable is part of the shader compilation system in Unreal Engine 5.
This setting variable is primarily used by the shader compilation subsystem within the Engine module. It is specifically utilized by the FShaderCompilingManager class, which manages the shader compilation process.
The value of this variable is set in the BaseEngine.ini configuration file under the [DevOptions.Shaders] section. It is then loaded into the FShaderCompilingManager during its initialization.
bPromptToRetryFailedShaderCompiles interacts with other variables such as bDebugBreakOnPromptToRetryShaderCompile and bAnyErrorLikelyToBeCodeError. These variables work together to determine how the engine should respond to shader compilation errors.
Developers should be aware that enabling this option can lead to interactive prompts during shader compilation, which may interrupt automated processes or builds. It’s particularly useful during development for catching and addressing shader errors promptly.
Best practices for using this variable include:
- Enabling it during active shader development to quickly identify and address compilation issues.
- Disabling it for automated builds or when working on non-shader related tasks to avoid interruptions.
- Using it in conjunction with bDebugBreakOnPromptToRetryShaderCompile when debugging shader issues in an IDE.
- Considering the impact on build times and automation when deciding whether to enable or disable this option.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:1963, section: [DevOptions.Shaders]
- INI Section:
DevOptions.Shaders
- Raw value:
False
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:2067
Scope: file
Source code excerpt:
#define DEBUG_SHADERCOMPILEWORKER 0
// Default value comes from bPromptToRetryFailedShaderCompiles in BaseEngine.ini
// This is set as a global variable to allow changing in the debugger even in release
// For example if there are a lot of content shader compile errors you want to skip over without relaunching
bool GRetryShaderCompilation = true;
static FShaderCompilingManager::EDumpShaderDebugInfo GDumpShaderDebugInfo = FShaderCompilingManager::EDumpShaderDebugInfo::Never;
static FAutoConsoleVariableRef CVarDumpShaderDebugInfo(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:5629
Scope (from outer to inner):
file
function FShaderCompilingManager::FShaderCompilingManager
Source code excerpt:
verify(GConfig->GetInt( TEXT("DevOptions.Shaders"), TEXT("MaxShaderJobBatchSize"), MaxShaderJobBatchSize, GEngineIni ));
verify(GConfig->GetBool( TEXT("DevOptions.Shaders"), TEXT("bPromptToRetryFailedShaderCompiles"), bPromptToRetryFailedShaderCompiles, GEngineIni ));
verify(GConfig->GetBool(TEXT("DevOptions.Shaders"), TEXT("bDebugBreakOnPromptToRetryShaderCompile"), bDebugBreakOnPromptToRetryShaderCompile, GEngineIni));
verify(GConfig->GetBool( TEXT("DevOptions.Shaders"), TEXT("bLogJobCompletionTimes"), bLogJobCompletionTimes, GEngineIni ));
GConfig->GetFloat(TEXT("DevOptions.Shaders"), TEXT("WorkerTimeToLive"), GRegularWorkerTimeToLive, GEngineIni);
GConfig->GetFloat(TEXT("DevOptions.Shaders"), TEXT("BuildWorkerTimeToLive"), GBuildWorkerTimeToLive, GEngineIni);
verify(GConfig->GetFloat( TEXT("DevOptions.Shaders"), TEXT("ProcessGameThreadTargetTime"), ProcessGameThreadTargetTime, GEngineIni ));
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:7140
Scope (from outer to inner):
file
function bool FShaderCompilingManager::HandlePotentialRetryOnError
Source code excerpt:
BuildErrorStringAndReport(ShaderErrorInfo, ErrorString);
if (UE_LOG_ACTIVE(LogShaders, Log) && (bAnyErrorLikelyToBeCodeError || bPromptToRetryFailedShaderCompiles || bSpecialEngineMaterial))
{
// Use debug break in debug with the debugger attached, otherwise message box
if (bDebugBreakOnPromptToRetryShaderCompile && FPlatformMisc::IsDebuggerPresent())
{
// A shader compile error has occurred, see the debug output for information.
// Double click the errors in the VS.NET output window and the IDE will take you directly to the file and line of the error.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShaderCompiler.h:716
Scope (from outer to inner):
file
class class FShaderCompilingManager : IAssetCompilingManager
Source code excerpt:
bool bAllowAsynchronousShaderCompiling;
/** Whether to ask to retry a failed shader compile error. */
bool bPromptToRetryFailedShaderCompiles;
/** If enabled when we enter the prompt to retry we will break in the debugger if one is attached rather than prompting. */
bool bDebugBreakOnPromptToRetryShaderCompile = false;
/** Whether to log out shader job completion times on the worker thread. Useful for tracking down which global shader is taking a long time. */
bool bLogJobCompletionTimes;
/** Target execution time for ProcessAsyncResults. Larger values speed up async shader map processing but cause more hitchiness while async compiling is happening. */
float ProcessGameThreadTargetTime;