r.ProfileGPU.ShowTransitions
r.ProfileGPU.ShowTransitions
#Overview
name: r.ProfileGPU.ShowTransitions
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allows profileGPU to display resource transition events.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.ProfileGPU.ShowTransitions is to control the display of resource transition events in GPU profiling. This setting variable is primarily used for debugging and performance analysis of GPU operations in Unreal Engine 5.
This setting variable is utilized by the RHI (Rendering Hardware Interface) subsystem, specifically in the D3D12RHI and VulkanRHI modules. These modules are responsible for interfacing with the DirectX 12 and Vulkan graphics APIs, respectively.
The value of this variable is set through the console variable system. It is defined as a TAutoConsoleVariable with a default value of 0, which means transition events are not shown by default.
This variable interacts with the GPU profiling system and affects the visibility of transition events in profiling tools. It is used in conjunction with the SCOPED_RHI_CONDITIONAL_DRAW_EVENTF macro, which conditionally adds profiling events based on the value of this variable.
Developers must be aware that enabling this variable may have a performance impact, as it adds additional profiling events to the GPU workload. It should primarily be used for debugging and optimization purposes, not in production builds.
Best practices when using this variable include:
- Enable it only when actively investigating GPU resource transitions.
- Use it in conjunction with other GPU profiling tools to get a comprehensive view of GPU performance.
- Remember to disable it after debugging to avoid unnecessary performance overhead.
- Be cautious when using it in shipping builds, as it may expose internal engine details.
When enabled, this variable allows developers to visualize and track resource transitions, which can be crucial for optimizing GPU performance and understanding the engine’s resource management behavior.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/GPUProfiler.cpp:52
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> GProfileGPUTransitions(
TEXT("r.ProfileGPU.ShowTransitions"),
0,
TEXT("Allows profileGPU to display resource transition events."),
ECVF_Default);
// Should we print a summary at the end?
static TAutoConsoleVariable<int32> GProfilePrintAssetSummary(
#Loc: <Workspace>/Engine/Source/Runtime/D3D12RHI/Private/D3D12Commands.cpp:570
Scope (from outer to inner):
file
function void FD3D12CommandContext::RHIBeginTransitions
Source code excerpt:
void FD3D12CommandContext::RHIBeginTransitions(TArrayView<const FRHITransition*> Transitions)
{
static IConsoleVariable* CVarShowTransitions = IConsoleManager::Get().FindConsoleVariable(TEXT("r.ProfileGPU.ShowTransitions"));
const bool bShowTransitionEvents = CVarShowTransitions->GetInt() != 0;
SCOPED_RHI_CONDITIONAL_DRAW_EVENTF(*this, RHIBeginTransitions, bShowTransitionEvents, TEXT("RHIBeginTransitions"));
for (const FRHITransition* Transition : Transitions)
{
const FD3D12TransitionData* Data = Transition->GetPrivateData<FD3D12TransitionData>();
#Loc: <Workspace>/Engine/Source/Runtime/D3D12RHI/Private/D3D12Commands.cpp:644
Scope (from outer to inner):
file
function void FD3D12CommandContext::RHIEndTransitions
Source code excerpt:
}
static IConsoleVariable* CVarShowTransitions = IConsoleManager::Get().FindConsoleVariable(TEXT("r.ProfileGPU.ShowTransitions"));
const bool bShowTransitionEvents = CVarShowTransitions->GetInt() != 0;
SCOPED_RHI_CONDITIONAL_DRAW_EVENTF(*this, RHIEndTransitions, bShowTransitionEvents, TEXT("RHIEndTransitions"));
// Update reserved resource memory mapping
for (const FRHITransition* Transition : Transitions)
{
#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanBarriers.cpp:1488
Scope (from outer to inner):
file
function void FVulkanCommandListContext::RHIBeginTransitions
Source code excerpt:
void FVulkanCommandListContext::RHIBeginTransitions(TArrayView<const FRHITransition*> Transitions)
{
static IConsoleVariable* CVarShowTransitions = IConsoleManager::Get().FindConsoleVariable(TEXT("r.ProfileGPU.ShowTransitions"));
const bool bShowTransitionEvents = CVarShowTransitions->GetInt() != 0;
SCOPED_RHI_CONDITIONAL_DRAW_EVENTF(*this, RHIBeginTransitions, bShowTransitionEvents, TEXT("RHIBeginTransitions"));
TRACE_CPUPROFILER_EVENT_SCOPE(RHIBeginTransitions);
if (Device->SupportsParallelRendering())
#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanBarriers.cpp:1516
Scope (from outer to inner):
file
function void FVulkanCommandListContext::RHIEndTransitions
Source code excerpt:
void FVulkanCommandListContext::RHIEndTransitions(TArrayView<const FRHITransition*> Transitions)
{
static IConsoleVariable* CVarShowTransitions = IConsoleManager::Get().FindConsoleVariable(TEXT("r.ProfileGPU.ShowTransitions"));
const bool bShowTransitionEvents = CVarShowTransitions->GetInt() != 0;
SCOPED_RHI_CONDITIONAL_DRAW_EVENTF(*this, RHIEndTransitions, bShowTransitionEvents, TEXT("RHIEndTransitions"));
TRACE_CPUPROFILER_EVENT_SCOPE(RHIEndTransitions);
const ERHIPipeline CurrentPipeline = Device->IsRealAsyncComputeContext(this) ? ERHIPipeline::AsyncCompute : ERHIPipeline::Graphics;