r.Streaming.StressTest
r.Streaming.StressTest
#Overview
name: r.Streaming.StressTest
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Set to non zero to stress test the streaming update.\nNegative values also slow down the IO.\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Streaming.StressTest is to enable stress testing of the texture streaming system in Unreal Engine 5. This console variable is used to simulate high-stress scenarios for the streaming update process, allowing developers to test the robustness and performance of the texture streaming system under demanding conditions.
This setting variable is primarily used in the Engine module, specifically within the texture streaming subsystem. Based on the callsites, it’s referenced in the TextureStreamingHelpers.cpp file, which is part of the Engine’s runtime streaming implementation.
The value of this variable is set through the console command system. It’s defined as a TAutoConsoleVariable, which means it can be changed at runtime using console commands or through configuration files.
The associated variable CVarStreamingStressTest interacts directly with r.Streaming.StressTest. They share the same value and purpose, with CVarStreamingStressTest being the actual C++ variable used in the code to access the console variable’s value.
Developers should be aware of several important aspects when using this variable:
- It’s marked with ECVF_Cheat, indicating it’s intended for testing and debugging purposes, not for use in shipping builds.
- Setting it to a non-zero value enables the stress test.
- Negative values not only stress test the streaming update but also slow down IO operations.
Best practices for using this variable include:
- Use it only during development and testing phases, not in production environments.
- When stress testing, start with small non-zero values and gradually increase to observe system behavior under different levels of stress.
- Monitor performance metrics closely when using this variable to identify potential bottlenecks or issues in the streaming system.
- Use in conjunction with other streaming-related console variables for comprehensive testing.
Regarding the associated variable CVarStreamingStressTest:
The purpose of CVarStreamingStressTest is to provide programmatic access to the r.Streaming.StressTest console variable within the C++ code. It allows the engine to read and react to changes in the stress test settings at runtime.
This variable is used directly in the FRenderAssetStreamingSettings::Update() function to modify streaming behavior when stress testing is enabled. When CVarStreamingStressTest is non-zero, it triggers changes in the streaming settings, such as increasing the number of frames for a full update and forcing mip level drops to create cancellation requests.
Developers should be aware that changes to CVarStreamingStressTest will immediately affect the streaming system’s behavior, potentially causing performance fluctuations or visual artifacts during gameplay. It’s crucial to use this variable judiciously and only when actively testing or debugging streaming issues.
Best practices for CVarStreamingStressTest include using it in conjunction with profiling tools to measure the impact of stress testing on performance, and resetting it to zero when not actively testing to ensure normal streaming behavior.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:280
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarStreamingStressTest(
TEXT("r.Streaming.StressTest"),
0,
TEXT("Set to non zero to stress test the streaming update.\n")
TEXT("Negative values also slow down the IO.\n"),
ECVF_Cheat);
static TAutoConsoleVariable<int32> CVarStreamingStressTestExtraIOLatency(
#Associated Variable and Callsites
This variable is associated with another variable named CVarStreamingStressTest
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:279
Scope: file
Source code excerpt:
ECVF_Default);
static TAutoConsoleVariable<int32> CVarStreamingStressTest(
TEXT("r.Streaming.StressTest"),
0,
TEXT("Set to non zero to stress test the streaming update.\n")
TEXT("Negative values also slow down the IO.\n"),
ECVF_Cheat);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:345
Scope (from outer to inner):
file
function void FRenderAssetStreamingSettings::Update
Source code excerpt:
#if !UE_BUILD_SHIPPING
if (CVarStreamingStressTest.GetValueOnAnyThread() != 0)
{
bStressTest = true;
// Increase threading stress between the gamethread update and the async task.
FramesForFullUpdate = FMath::Max<int32>(CVarStreamingStressTestFramesForFullUpdate.GetValueOnAnyThread(), 0);
// This will create cancelation requests.
DropMips = 2;