DebugViewModeHelpers.Enable

DebugViewModeHelpers.Enable

#Overview

name: DebugViewModeHelpers.Enable

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of DebugViewModeHelpers.Enable is to control the enabling of debug view mode shaders in Unreal Engine 5. This setting is primarily used for the rendering system, specifically for debug visualization purposes.

This setting variable is relied upon by the Engine module, particularly in the debug view mode helpers subsystem. It’s used to determine whether debug view mode shaders should be enabled or compiled.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of true, but can be changed at runtime through the console or configuration files.

The associated variable CVarEnableDebugViewModeHelpers directly interacts with DebugViewModeHelpers.Enable. They share the same value and purpose.

Developers must be aware that:

  1. This variable affects the compilation and execution of debug view mode shaders.
  2. Disabling this variable will prevent debug view mode shaders from being compiled or used, which can impact debugging and visualization capabilities.
  3. It’s typically only disabled for special case editor builds that don’t require these shaders.

Best practices when using this variable include:

  1. Keep it enabled by default for most development scenarios to maintain full debugging capabilities.
  2. Only disable it if you’re certain that your specific build doesn’t require debug view mode shaders, which could potentially save some resources.
  3. Be cautious when disabling it, as it may limit your ability to diagnose rendering issues.

Regarding the associated variable CVarEnableDebugViewModeHelpers:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DebugViewModeHelpers.cpp:22

Scope: file

Source code excerpt:


static TAutoConsoleVariable<bool> CVarEnableDebugViewModeHelpers(
	TEXT("DebugViewModeHelpers.Enable"),
	true,
	TEXT("Specifies whether to enable the debug view mode shaders. Typically only disabled for a special case editor build, if it doesn't require them"),
	ECVF_Default);

const TCHAR* DebugViewShaderModeToString(EDebugViewShaderMode InShaderMode)
{

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DebugViewModeHelpers.cpp:21

Scope: file

Source code excerpt:

#define LOCTEXT_NAMESPACE "LogDebugViewMode"

static TAutoConsoleVariable<bool> CVarEnableDebugViewModeHelpers(
	TEXT("DebugViewModeHelpers.Enable"),
	true,
	TEXT("Specifies whether to enable the debug view mode shaders. Typically only disabled for a special case editor build, if it doesn't require them"),
	ECVF_Default);

const TCHAR* DebugViewShaderModeToString(EDebugViewShaderMode InShaderMode)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DebugViewModeHelpers.cpp:72

Scope (from outer to inner):

file
function     bool AllowDebugViewVSDSHS

Source code excerpt:

bool AllowDebugViewVSDSHS(EShaderPlatform Platform)
{
	if(!CVarEnableDebugViewModeHelpers.GetValueOnAnyThread())
	{
		return false;
	}
	return IsPCPlatform(Platform); 
}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DebugViewModeHelpers.cpp:118

Scope (from outer to inner):

file
function     bool ShouldCompileDebugViewModeShader

Source code excerpt:

bool ShouldCompileDebugViewModeShader(const FMeshMaterialShaderPermutationParameters& Parameters)
{
	if(!CVarEnableDebugViewModeHelpers.GetValueOnAnyThread())
	{
		return false;
	}

	if (!PlatformSupportsDebugViewShaders(Parameters.Platform))
	{