ShowFlag.VirtualTextureResidency

ShowFlag.VirtualTextureResidency

#Overview

name: ShowFlag.VirtualTextureResidency

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 ShowFlag.VirtualTextureResidency is to debug the Virtual Texture System in Unreal Engine 5. This setting variable is primarily used for development and debugging purposes, allowing developers to visualize and inspect the residency of virtual textures in the engine.

The Unreal Engine subsystem that relies on this setting variable is the Rendering system, specifically the Virtual Texture System. This can be inferred from the file location (Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp) and the context of the code.

The value of this variable is set using the SHOWFLAG_FIXED_IN_SHIPPING macro, which suggests that it’s not available in shipping builds. It’s set to 0 by default, meaning it’s disabled unless explicitly enabled during development.

The associated variable VirtualTextureResidency interacts directly with ShowFlag.VirtualTextureResidency. They share the same value and purpose.

Developers must be aware that this variable is only available in non-shipping builds. It’s intended for debugging and development purposes, so it should not be relied upon for any gameplay or visual features in the final product.

Best practices when using this variable include:

  1. Only enable it when actively debugging virtual texture issues.
  2. Be mindful of potential performance impact when enabled, as it may introduce additional overhead for visualization.
  3. Use it in conjunction with other Virtual Texture System debugging tools for comprehensive analysis.
  4. Disable it before creating shipping builds to ensure it doesn’t affect performance in the final product.

Regarding the associated variable VirtualTextureResidency:

The purpose of VirtualTextureResidency is identical to ShowFlag.VirtualTextureResidency. It’s used to debug the Virtual Texture System in Unreal Engine 5.

This variable is also part of the Rendering system, specifically the Virtual Texture System.

The value is set in the same way as ShowFlag.VirtualTextureResidency, using the SHOWFLAG_FIXED_IN_SHIPPING macro.

VirtualTextureResidency directly interacts with ShowFlag.VirtualTextureResidency, sharing the same value and purpose.

Developers should be aware that this variable is also only available in non-shipping builds and should be used for debugging purposes only.

The best practices for using VirtualTextureResidency are the same as those for ShowFlag.VirtualTextureResidency. It should be used judiciously during development and disabled for shipping builds.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:425

Scope: file

Source code excerpt:


/** Debug the Virtual Texture System */
SHOWFLAG_FIXED_IN_SHIPPING(0, VirtualTextureResidency, SFG_Hidden, NSLOCTEXT("UnrealEd", "VirtualTextureResidency", "Virtual Texture Residency"))

/** Input Debug Visualizer */
SHOWFLAG_FIXED_IN_SHIPPING(0, InputDebugVisualizer, SFG_Hidden, NSLOCTEXT("UnrealEd", "InputDebugVisualizer", "Input Debug Visualizer"))

/** Use screen space tracing in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenScreenTraces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenScreenTracesSF", "Screen Traces"))

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:425

Scope: file

Source code excerpt:


/** Debug the Virtual Texture System */
SHOWFLAG_FIXED_IN_SHIPPING(0, VirtualTextureResidency, SFG_Hidden, NSLOCTEXT("UnrealEd", "VirtualTextureResidency", "Virtual Texture Residency"))

/** Input Debug Visualizer */
SHOWFLAG_FIXED_IN_SHIPPING(0, InputDebugVisualizer, SFG_Hidden, NSLOCTEXT("UnrealEd", "InputDebugVisualizer", "Input Debug Visualizer"))

/** Use screen space tracing in Lumen */
SHOWFLAG_ALWAYS_ACCESSIBLE(LumenScreenTraces, SFG_Lumen, NSLOCTEXT("UnrealEd", "LumenScreenTracesSF", "Screen Traces"))

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp:346

Scope (from outer to inner):

file
function     FVirtualTextureSystem::FVirtualTextureSystem

Source code excerpt:

#if !UE_BUILD_SHIPPING
	OnScreenMessageDelegateHandle = FRendererOnScreenNotification::Get().AddLambda([this](FCoreDelegates::FSeverityMessageMap& OutMessages) { GetOnScreenMessages(OutMessages); });
	DrawResidencyHudDelegateHandle = UDebugDrawService::Register(TEXT("VirtualTextureResidency"), FDebugDrawDelegate::CreateRaw(this, &FVirtualTextureSystem::DrawResidencyHud));
#endif
}

FVirtualTextureSystem::~FVirtualTextureSystem()
{
#if !UE_BUILD_SHIPPING