r.ShaderCompiler.DebugDumpJobInputHashes

r.ShaderCompiler.DebugDumpJobInputHashes

#Overview

name: r.ShaderCompiler.DebugDumpJobInputHashes

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.ShaderCompiler.DebugDumpJobInputHashes is to control the debugging output of shader compilation jobs, specifically for dumping the input hash of each job.

This setting variable is primarily used in the shader compilation system of Unreal Engine. It is referenced in the ShaderCompiler.cpp file, which is part of the Engine module.

The value of this variable is set through a console variable (CVarDebugDumpJobInputHashes) using the TAutoConsoleVariable template. It is initialized to false by default, meaning the debug dumping is turned off unless explicitly enabled.

The associated variable CVarDebugDumpJobInputHashes directly interacts with r.ShaderCompiler.DebugDumpJobInputHashes. They share the same value and purpose.

Developers must be aware that enabling this variable will cause additional debug information to be written to disk (specifically, an InputHash.txt file). This can be useful for debugging shader compilation issues but may impact performance and disk usage if left enabled in production builds.

Best practices for using this variable include:

  1. Only enable it when debugging shader compilation issues.
  2. Remember to disable it after debugging to avoid unnecessary performance overhead and disk writes.
  3. Use it in conjunction with other shader debugging tools and variables for comprehensive analysis.

Regarding the associated variable CVarDebugDumpJobInputHashes:

Its purpose is to provide programmatic access to the r.ShaderCompiler.DebugDumpJobInputHashes setting within the C++ code.

It is used in the Engine module, specifically in the shader compilation system.

The value is set when the console variable is initialized and can be changed at runtime through console commands.

It interacts directly with the r.ShaderCompiler.DebugDumpJobInputHashes console variable, effectively controlling the same functionality.

Developers should be aware that this variable is marked as ECVF_ReadOnly, meaning its value should not be modified directly in code, but rather through the console variable system.

Best practices for using CVarDebugDumpJobInputHashes include:

  1. Use GetValueOnAnyThread() to access its current value in a thread-safe manner.
  2. Consider the performance implications of frequently checking this value in performance-critical code paths.
  3. Use it in conjunction with other debugging flags and tools when investigating shader compilation issues.

#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:166

Scope: file

Source code excerpt:


static TAutoConsoleVariable<bool> CVarDebugDumpJobInputHashes(
	TEXT("r.ShaderCompiler.DebugDumpJobInputHashes"),
	false,
	TEXT("If true, the job input hash will be dumped alongside other debug data (in InputHash.txt)"),
	ECVF_ReadOnly);

static TAutoConsoleVariable<bool> CVarDebugDumpJobDiagnostics(
	TEXT("r.ShaderCompiler.DebugDumpJobDiagnostics"),

#Associated Variable and Callsites

This variable is associated with another variable named CVarDebugDumpJobInputHashes. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:165

Scope: file

Source code excerpt:

	ECVF_ReadOnly);

static TAutoConsoleVariable<bool> CVarDebugDumpJobInputHashes(
	TEXT("r.ShaderCompiler.DebugDumpJobInputHashes"),
	false,
	TEXT("If true, the job input hash will be dumped alongside other debug data (in InputHash.txt)"),
	ECVF_ReadOnly);

static TAutoConsoleVariable<bool> CVarDebugDumpJobDiagnostics(

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:6058

Scope (from outer to inner):

file
function     EShaderDebugInfoFlags FShaderCompilingManager::GetDumpShaderDebugInfoFlags

Source code excerpt:

	}
	
	if (CVarDebugDumpJobInputHashes.GetValueOnAnyThread())
	{
		Flags |= EShaderDebugInfoFlags::InputHash;
	}

	if (CVarDebugDumpJobDiagnostics.GetValueOnAnyThread())
	{