r.ShaderPipelineCache.ReportPSO

r.ShaderPipelineCache.ReportPSO

#Overview

name: r.ShaderPipelineCache.ReportPSO

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 r.ShaderPipelineCache.ReportPSO is to control the reporting of new Pipeline State Object (PSO) entries in the shader pipeline cache system. It is primarily used for debugging and performance optimization in the rendering system of Unreal Engine 5.

This setting variable is part of the RHI (Rendering Hardware Interface) module, which is a core subsystem of Unreal Engine responsible for abstracting the graphics API. Specifically, it’s used in the pipeline file cache management system.

The value of this variable is set through a console variable (CVarPSOFileCacheReportPSO) in the RHI module. It’s defined with a default value of PIPELINE_CACHE_DEFAULT_ENABLED, which is likely a predefined constant.

The associated variable CVarPSOFileCacheReportPSO interacts directly with r.ShaderPipelineCache.ReportPSO. They share the same value and purpose.

Developers must be aware that:

  1. When set to 1, it reports new PSO entries via a delegate but does not record or modify any cache file.
  2. This setting is render thread safe, meaning it can be safely accessed from the render thread.
  3. It’s primarily used for debugging and performance analysis, not for regular gameplay.

Best practices when using this variable include:

  1. Use it during development and performance optimization phases, not in shipping builds.
  2. Monitor the output when enabled to track new PSO entries being created.
  3. Use in conjunction with other shader pipeline cache settings for comprehensive optimization.

Regarding the associated variable CVarPSOFileCacheReportPSO:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/PipelineFileCache.cpp:110

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarPSOFileCacheReportPSO(
														   TEXT("r.ShaderPipelineCache.ReportPSO"),
														   PIPELINE_CACHE_DEFAULT_ENABLED,
														   TEXT("1 reports new PSO entries via a delegate, but does not record or modify any cache file."),
														   ECVF_Default | ECVF_RenderThreadSafe
														   );

static int32 GPSOExcludePrecachePSOsInFileCache = 0;

#Associated Variable and Callsites

This variable is associated with another variable named CVarPSOFileCacheReportPSO. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/PipelineFileCache.cpp:109

Scope: file

Source code excerpt:

														   );

static TAutoConsoleVariable<int32> CVarPSOFileCacheReportPSO(
														   TEXT("r.ShaderPipelineCache.ReportPSO"),
														   PIPELINE_CACHE_DEFAULT_ENABLED,
														   TEXT("1 reports new PSO entries via a delegate, but does not record or modify any cache file."),
														   ECVF_Default | ECVF_RenderThreadSafe
														   );

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/PipelineFileCache.cpp:3084

Scope (from outer to inner):

file
function     bool FPipelineFileCacheManager::ReportNewPSOs

Source code excerpt:

        UE_CLOG(bCmdLineForce, LogRHI, Warning, TEXT("****************************** Forcing reporting of new PSOs from command line"));
    }
	return (bCmdLineForce || CVarPSOFileCacheReportPSO.GetValueOnAnyThread() == 1);
}

bool FPipelineFileCacheManager::LogPSODetails()
{
    static bool bOnce = false;
    static bool bCmdLineOption = false;