UntrackTexture

UntrackTexture

#Overview

name: UntrackTexture

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 UntrackTexture is to remove a specific texture from the content streaming system’s tracking list. This function is part of Unreal Engine’s content streaming management, which is responsible for dynamically loading and unloading textures and other render assets to optimize memory usage and performance.

UntrackTexture is primarily used within the Engine module, specifically in the content streaming subsystem. It’s referenced in the ContentStreaming.cpp and StreamingManagerTexture.cpp files, which are core components of Unreal Engine’s streaming system.

The value of this variable is not set directly, as UntrackTexture is a function rather than a variable. It takes a texture name as a parameter and calls the more general UntrackRenderAsset function to perform the untracking operation.

UntrackTexture interacts closely with the UntrackRenderAsset function, which it calls internally. This suggests that UntrackTexture is a texture-specific wrapper for the more general render asset untracking functionality.

Developers should be aware that using UntrackTexture will remove the specified texture from the streaming system’s management. This means the texture will no longer be automatically loaded or unloaded based on streaming rules, which could impact performance and memory usage if not used carefully.

Best practices when using UntrackTexture include:

  1. Only use it when you need fine-grained control over texture streaming for specific assets.
  2. Ensure you have a good reason for untracking a texture, as it bypasses the engine’s built-in optimization systems.
  3. Keep track of untracked textures and consider re-tracking them when they’re no longer needed in their untracked state.
  4. Use it in conjunction with proper profiling and memory management to ensure you’re not causing unnecessary memory bloat or performance issues.
  5. Be cautious when using it in shipping builds, as it may impact the game’s overall performance and memory usage characteristics.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ContentStreaming.cpp:206

Scope (from outer to inner):

file
function     bool UntrackTexture

Source code excerpt:

}

bool UntrackTexture(const FString& TextureName)
{
	return UntrackRenderAsset(TextureName);
}

/**
 * Lists all currently tracked texture/mesh names in the specified log.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ContentStreaming.cpp:339

Scope (from outer to inner):

file
function     bool UntrackTexture

Source code excerpt:

	return false;
}
bool UntrackTexture( const FString& TextureName )
{
	return UntrackRenderAsset(TextureName);
}
void ListTrackedRenderAssets(FOutputDevice& Ar, int32 NumAssets)
{
}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/StreamingManagerTexture.cpp:2948

Scope (from outer to inner):

file
function     bool FRenderAssetStreamingManager::Exec

Source code excerpt:

		return HandleDebugTrackedRenderAssetsCommand( Cmd, Ar );
	}
	else if (FParse::Command(&Cmd,TEXT("UntrackTexture"))
		|| FParse::Command(&Cmd, TEXT("UntrackRenderAsset")))
	{
		return HandleUntrackRenderAssetCommand( Cmd, Ar );
	}
	else if (FParse::Command(&Cmd,TEXT("StreamOut")))
	{