PauseTextureStreaming

PauseTextureStreaming

#Overview

name: PauseTextureStreaming

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 PauseTextureStreaming is to control the pausing and resuming of texture streaming in Unreal Engine 5. This function is part of the content streaming system, specifically focused on managing the streaming of textures and other render assets.

PauseTextureStreaming is primarily used by the Engine’s content streaming subsystem, particularly within the IRenderAssetStreamingManager interface. Based on the callsites, it’s clear that this function is implemented in the core Engine module and is likely utilized by various rendering and asset management components.

The value of this variable is set through the PauseTextureStreaming function, which takes a boolean parameter bInShouldPause. This function is called to either pause (true) or resume (false) texture streaming.

While not directly visible in the provided code snippets, it’s likely that this function interacts with other streaming-related variables and systems within the Engine. It may affect memory usage, rendering performance, and loading times of textures and other render assets.

Developers should be aware that pausing texture streaming can have significant impacts on game performance and memory usage. When paused, textures may not load or unload as expected, which could lead to increased memory consumption or visual artifacts if not managed properly.

Best practices when using this variable include:

  1. Use it judiciously, typically for debugging purposes or in specific scenarios where you need to control texture streaming manually.
  2. Always ensure to resume texture streaming when it’s no longer necessary to have it paused.
  3. Be mindful of the performance and memory implications when pausing texture streaming, especially on platforms with limited resources.
  4. Consider using this in conjunction with other streaming controls and profiling tools to optimize your game’s streaming behavior.
  5. Document any usage of this function clearly, as it can have wide-ranging effects on the game’s performance and visual quality.

#References in C++ code

#Callsites

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

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

Scope (from outer to inner):

file
function     void IRenderAssetStreamingManager::PauseTextureStreaming

Source code excerpt:

}

void IRenderAssetStreamingManager::PauseTextureStreaming(bool bInShouldPause)
{
	PauseRenderAssetStreaming(bInShouldPause);
}

/*-----------------------------------------------------------------------------
	FStreamingManagerCollection implementation.

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

Scope: file

Source code excerpt:

		return HandleStreamOutCommand( Cmd, Ar );
	}
	else if (FParse::Command(&Cmd,TEXT("PauseTextureStreaming"))
		|| FParse::Command(&Cmd, TEXT("PauseRenderAssetStreaming")))
	{
		return HandlePauseRenderAssetStreamingCommand( Cmd, Ar );
	}
	else if (FParse::Command(&Cmd,TEXT("StreamingManagerMemory")))
	{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ContentStreaming.h:492

Scope: file

Source code excerpt:

	ENGINE_API void AddStreamingTexture(UTexture2D* Texture);
	ENGINE_API void RemoveStreamingTexture(UTexture2D* Texture);
	ENGINE_API void PauseTextureStreaming(bool bInShouldPause);
	//END: APIs for backward compatibility

	/** Notify the streamer that the mounted state of a file needs to be re-evaluated. */
	virtual void MarkMountedStateDirty(FIoFilenameHash FilenameHash) = 0;

	virtual void AddRenderedTextureStats(TMap<FString, FRenderedTextureStats>& InOutRenderedTextureAssets) = 0;