r.RenderThreadTimeIncludesDependentWaits
r.RenderThreadTimeIncludesDependentWaits
#Overview
name: r.RenderThreadTimeIncludesDependentWaits
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0: RT stat only includes non-idle time, 1: RT stat includes dependent waits (matching RenderThreadTime_CriticalPath)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.RenderThreadTimeIncludesDependentWaits is to control how render thread time is measured and reported in Unreal Engine’s performance statistics. Specifically, it determines whether dependent waits should be included in the render thread time calculation.
This setting variable is primarily used in the rendering system, particularly in the Slate RHI renderer module. It affects how the engine measures and reports render thread performance.
The value of this variable is set through a console variable (CVarRenderThreadTimeIncludesDependentWaits) defined in the SlateRHIRenderer.cpp file. It’s initialized with a default value of 0, meaning that by default, render thread time only includes non-idle time.
The associated variable CVarRenderThreadTimeIncludesDependentWaits directly interacts with r.RenderThreadTimeIncludesDependentWaits. They share the same value and purpose.
Developers must be aware that changing this variable will affect how render thread performance is reported. When set to 1, it includes dependent waits in the render thread time, which can provide a more comprehensive view of render thread performance but may also inflate the reported time compared to the default setting.
Best practices when using this variable include:
- Use it for detailed performance analysis when you need to understand the full impact of render thread operations, including dependent waits.
- Be consistent in its usage when comparing performance across different scenarios or builds.
- Document clearly when this setting is changed, as it will affect performance metrics and could lead to misinterpretation if not properly communicated.
Regarding the associated variable CVarRenderThreadTimeIncludesDependentWaits:
- Its purpose is identical to r.RenderThreadTimeIncludesDependentWaits.
- It’s used in the SlateRHIRenderer module to control the behavior of render thread time measurement.
- Its value is set when the console variable is defined, with a default of 0.
- It directly affects the GRenderThreadTime global variable, setting it to GRenderThreadTimeCriticalPath when enabled.
- Developers should be aware that this variable is checked on the render thread, so changes may not be immediately reflected.
- Best practices include using it in conjunction with other rendering performance metrics for a comprehensive understanding of the render thread behavior.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/SlateRHIRenderer/Private/SlateRHIRenderer.cpp:128
Scope: file
Source code excerpt:
// RT stat including waits toggle. Off by default for historical tracking reasons
TAutoConsoleVariable<int32> CVarRenderThreadTimeIncludesDependentWaits(
TEXT("r.RenderThreadTimeIncludesDependentWaits"),
0,
TEXT("0: RT stat only includes non-idle time, 1: RT stat includes dependent waits (matching RenderThreadTime_CriticalPath)"),
ECVF_Default
);
#Associated Variable and Callsites
This variable is associated with another variable named CVarRenderThreadTimeIncludesDependentWaits
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/SlateRHIRenderer/Private/SlateRHIRenderer.cpp:127
Scope: file
Source code excerpt:
// RT stat including waits toggle. Off by default for historical tracking reasons
TAutoConsoleVariable<int32> CVarRenderThreadTimeIncludesDependentWaits(
TEXT("r.RenderThreadTimeIncludesDependentWaits"),
0,
TEXT("0: RT stat only includes non-idle time, 1: RT stat includes dependent waits (matching RenderThreadTime_CriticalPath)"),
ECVF_Default
);
#Loc: <Workspace>/Engine/Source/Runtime/SlateRHIRenderer/Private/SlateRHIRenderer.cpp:1608
Scope (from outer to inner):
file
function void FSlateRHIRenderer::DrawWindow_RenderThread
Source code excerpt:
if (CVarRenderThreadTimeIncludesDependentWaits.GetValueOnRenderThread())
{
// Optionally force the renderthread stat to include dependent waits
GRenderThreadTime = GRenderThreadTimeCriticalPath;
}
// Reset the idle stats