r.VT.ProduceLockedTilesOnFlush

r.VT.ProduceLockedTilesOnFlush

#Overview

name: r.VT.ProduceLockedTilesOnFlush

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.ProduceLockedTilesOnFlush is to control whether locked tiles should be reproduced when flushing the virtual texture cache. This setting is part of Unreal Engine’s virtual texturing system, which is a key component of the rendering pipeline.

The Unreal Engine subsystem that relies on this setting variable is the Renderer, specifically the virtual texturing system. This can be inferred from the file location (VirtualTextureSystem.cpp) and the context of the code.

The value of this variable is set through a console variable (CVarVTProduceLockedTilesOnFlush) with a default value of 1 (true). It can be changed at runtime through console commands or programmatically.

The associated variable CVarVTProduceLockedTilesOnFlush directly interacts with r.VT.ProduceLockedTilesOnFlush. They share the same value and purpose.

Developers must be aware that this variable affects the behavior of the virtual texture system during cache flushing. When enabled (set to 1), it causes locked tiles to be reproduced when the cache is flushed. This can impact performance and memory usage, especially in scenarios with frequent cache flushes or many locked tiles.

Best practices when using this variable include:

  1. Leaving it at the default value (1) unless there’s a specific reason to change it.
  2. If disabling it, carefully monitor the impact on texture quality and rendering performance.
  3. Consider the trade-off between memory usage and texture availability when modifying this setting.
  4. Test thoroughly with different values in various scenarios to understand its impact on your specific project.

Regarding the associated variable CVarVTProduceLockedTilesOnFlush:

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

Scope: file

Source code excerpt:

);
static TAutoConsoleVariable<int32> CVarVTProduceLockedTilesOnFlush(
	TEXT("r.VT.ProduceLockedTilesOnFlush"),
	1,
	TEXT("Should locked tiles be (re)produced when flushing the cache"),
	ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarVTResidencyShow(
	TEXT("r.VT.Residency.Show"),

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarVTProduceLockedTilesOnFlush(
	TEXT("r.VT.ProduceLockedTilesOnFlush"),
	1,
	TEXT("Should locked tiles be (re)produced when flushing the cache"),
	ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarVTResidencyShow(

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

Scope (from outer to inner):

file
function     TUniquePtr<FVirtualTextureUpdater> FVirtualTextureSystem::BeginUpdate

Source code excerpt:

			if (PhysicalSpace)
			{
				if (CVarVTProduceLockedTilesOnFlush.GetValueOnRenderThread())
				{
					// Collect locked pages to be produced again
					PhysicalSpace->GetPagePool().GetAllLockedPages(this, MappedTilesToProduce);
				}
				// Flush unlocked pages
				PhysicalSpace->GetPagePool().EvictAllPages(this);