r.ProfileGPU.Root
r.ProfileGPU.Root
#Overview
name: r.ProfileGPU.Root
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allows to filter the tree when using ProfileGPU, the pattern match is case sensitive.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.ProfileGPU.Root is to filter the event tree when using the GPU profiler in Unreal Engine. It allows developers to focus on specific parts of the GPU profiling data by applying a case-sensitive pattern match.
This setting variable is primarily used in the GPU profiling subsystem of Unreal Engine’s rendering module. It’s part of the RHI (Rendering Hardware Interface) implementation, specifically in the GPU profiler component.
The value of this variable is set through the console variable system. It can be changed at runtime using console commands or through configuration files.
The associated variable GProfileGPURootCVar interacts directly with r.ProfileGPU.Root. They share the same value and purpose, with GProfileGPURootCVar being the actual TAutoConsoleVariable object that holds the value.
Developers should be aware that:
- The filter is case-sensitive, which means “Render” and “render” would produce different results.
- The default value is “*”, which means no filtering is applied.
- This variable affects the output of the GPU profiler, so it’s crucial for performance analysis and optimization tasks.
Best practices when using this variable include:
- Use specific filter patterns to focus on areas of interest in the GPU profiling data.
- Remember to reset the filter to “*” after focused analysis to ensure you’re not missing other important data.
- Combine this with other profiling tools and variables (like r.ProfileGPU.ThresholdPercent) for comprehensive performance analysis.
Regarding the associated variable GProfileGPURootCVar:
- It’s the actual console variable object that stores and manages the r.ProfileGPU.Root setting.
- It’s used internally by the GPU profiler to access the current filter value.
- When querying the value, use GetValueOnRenderThread() to ensure thread-safe access in rendering code.
- This variable is initialized at startup and can be modified at runtime, affecting the GPU profiler’s behavior dynamically.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/GPUProfiler.cpp:28
Scope: file
Source code excerpt:
static TAutoConsoleVariable<FString> GProfileGPURootCVar(
TEXT("r.ProfileGPU.Root"),
TEXT("*"),
TEXT("Allows to filter the tree when using ProfileGPU, the pattern match is case sensitive."),
ECVF_Default);
static TAutoConsoleVariable<float> GProfileThresholdPercent(
TEXT("r.ProfileGPU.ThresholdPercent"),
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/GPUProfiler.cpp:494
Scope (from outer to inner):
file
function void FGPUProfilerEventNodeFrame::DumpEventTree
Source code excerpt:
}
static IConsoleVariable* CVar2 = IConsoleManager::Get().FindConsoleVariable(TEXT("r.ProfileGPU.Root"));
FString RootWildcardString = CVar2->GetString();
FWildcardString RootWildcard(RootWildcardString);
FGPUProfileStatSummary Summary;
for (int32 BaseNodeIndex = 0; BaseNodeIndex < EventTree.Num(); BaseNodeIndex++)
{
#Associated Variable and Callsites
This variable is associated with another variable named GProfileGPURootCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/GPUProfiler.cpp:27
Scope: file
Source code excerpt:
ECVF_Default);
static TAutoConsoleVariable<FString> GProfileGPURootCVar(
TEXT("r.ProfileGPU.Root"),
TEXT("*"),
TEXT("Allows to filter the tree when using ProfileGPU, the pattern match is case sensitive."),
ECVF_Default);
static TAutoConsoleVariable<float> GProfileThresholdPercent(
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/GPUProfiler.cpp:459
Scope (from outer to inner):
file
function void FGPUProfilerEventNodeFrame::DumpEventTree
Source code excerpt:
FString ConfigString;
if (GProfileGPURootCVar.GetValueOnRenderThread() != TEXT("*"))
{
ConfigString += FString::Printf(TEXT("Root filter: %s "), *GProfileGPURootCVar.GetValueOnRenderThread());
}
if (GProfileThresholdPercent.GetValueOnRenderThread() > 0.0f)
{
ConfigString += FString::Printf(TEXT("Threshold: %.2f%% "), GProfileThresholdPercent.GetValueOnRenderThread());
}