r.VT.Residency.Notify

r.VT.Residency.Notify

#Overview

name: r.VT.Residency.Notify

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.VT.Residency.Notify is to control the display of on-screen notifications for virtual texture physical pool residency. This setting is part of Unreal Engine’s virtual texturing system, which is a key component of the rendering system.

The Unreal Engine subsystem that relies on this setting variable is the Renderer module, specifically the Virtual Texture System. This can be seen from the file path where the variable is defined: Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp.

The value of this variable is set through the console variable system. It’s defined as a TAutoConsoleVariable with a default value of 0, meaning notifications are disabled by default.

This variable interacts with the associated variable CVarVTResidencyNotify. They share the same value and are used interchangeably in the code.

Developers must be aware that enabling this variable (setting it to a non-zero value) will cause on-screen notifications to appear, which could be useful for debugging but might interfere with normal gameplay or performance testing.

Best practices when using this variable include:

  1. Use it primarily for debugging and development purposes.
  2. Disable it (set to 0) for final builds or performance testing.
  3. Be aware that enabling notifications might have a small performance impact.

Regarding the associated variable CVarVTResidencyNotify:

The purpose of CVarVTResidencyNotify is identical to r.VT.Residency.Notify. It’s an internal representation of the console variable within the C++ code.

This variable is used directly in the FVirtualTextureSystem::GetOnScreenMessages function to determine whether to display the residency notifications. If the value is 0, the function returns early without adding any messages.

Developers should treat CVarVTResidencyNotify the same way as r.VT.Residency.Notify. They are effectively the same variable, with r.VT.Residency.Notify being the console-accessible name and CVarVTResidencyNotify being the C++ variable name.

When working with either of these variables, developers should remember that they are part of the virtual texturing system and can be valuable tools for monitoring and debugging virtual texture residency issues during development.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

);
static TAutoConsoleVariable<int32> CVarVTResidencyNotify(
	TEXT("r.VT.Residency.Notify"),
	0,
	TEXT("Show on screen notifications for virtual texture physical pool residency"),
	ECVF_Default
);
static TAutoConsoleVariable<int32> CVarVTCsvStats(
	TEXT("r.VT.CsvStats"),

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_Default
);
static TAutoConsoleVariable<int32> CVarVTResidencyNotify(
	TEXT("r.VT.Residency.Notify"),
	0,
	TEXT("Show on screen notifications for virtual texture physical pool residency"),
	ECVF_Default
);
static TAutoConsoleVariable<int32> CVarVTCsvStats(

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

Scope (from outer to inner):

file
function     void FVirtualTextureSystem::GetOnScreenMessages

Source code excerpt:

void FVirtualTextureSystem::GetOnScreenMessages(FCoreDelegates::FSeverityMessageMap& OutMessages)
{
	if (CVarVTResidencyNotify.GetValueOnRenderThread() == 0)
	{
		return;
	}

	for (int32 SpaceIndex = 0u; SpaceIndex < PhysicalSpaces.Num(); ++SpaceIndex)
	{