r.Vulkan.PipelineCacheFromShaderPipelineCache

r.Vulkan.PipelineCacheFromShaderPipelineCache

#Overview

name: r.Vulkan.PipelineCacheFromShaderPipelineCache

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.Vulkan.PipelineCacheFromShaderPipelineCache is to control how the Vulkan pipeline cache is managed and loaded in relation to the shader pipeline cache.

This setting variable is primarily used by the Vulkan RHI (Runtime Hardware Interface) subsystem of Unreal Engine 5. It’s specifically relevant to the pipeline state management in Vulkan-based rendering.

The value of this variable is set through a console variable (CVar) system, which allows it to be changed at runtime. It’s defined as a TAutoConsoleVariable with a default value of PLATFORM_ANDROID, suggesting it’s primarily intended for use on Android platforms.

The associated variable GPipelineCacheFromShaderPipelineCacheCvar directly interacts with r.Vulkan.PipelineCacheFromShaderPipelineCache. They share the same value and purpose.

Developers must be aware that this variable has two modes of operation:

  1. When set to 0, it looks for a pipeline cache in the normal locations with normal names.
  2. When set to 1, it ties the Vulkan pipeline cache to the shader pipeline cache and uses the PSOFC (Pipeline State Object File Cache) GUID as part of the filename.

Best practices when using this variable include:

  1. Consider the target platform, especially for Android development.
  2. Understand the implications of tying the Vulkan pipeline cache to the shader pipeline cache.
  3. Be aware that changing this value can affect the loading behavior of the pipeline cache, which could impact performance and startup times.

Regarding the associated variable GPipelineCacheFromShaderPipelineCacheCvar:

Developers should be cautious when modifying this variable, as it can significantly impact how pipeline caches are managed and loaded, which in turn can affect rendering performance and game startup times.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanPipeline.cpp:107

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> GPipelineCacheFromShaderPipelineCacheCvar(
	TEXT("r.Vulkan.PipelineCacheFromShaderPipelineCache"),
	PLATFORM_ANDROID,
	TEXT("0 look for a pipeline cache in the normal locations with the normal names.")
	TEXT("1 tie the vulkan pipeline cache to the shader pipeline cache, use the PSOFC guid as part of the filename, etc."),
	ECVF_ReadOnly
);

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanPipeline.cpp:106

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<int32> GPipelineCacheFromShaderPipelineCacheCvar(
	TEXT("r.Vulkan.PipelineCacheFromShaderPipelineCache"),
	PLATFORM_ANDROID,
	TEXT("0 look for a pipeline cache in the normal locations with the normal names.")
	TEXT("1 tie the vulkan pipeline cache to the shader pipeline cache, use the PSOFC guid as part of the filename, etc."),
	ECVF_ReadOnly
);

#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanPipeline.cpp:441

Scope (from outer to inner):

file
function     void FVulkanPipelineStateCacheManager::InitAndLoad

Source code excerpt:

	else
	{
		if (GPipelineCacheFromShaderPipelineCacheCvar.GetValueOnAnyThread() == 0)
		{
			Load(CacheFilenames, GlobalPSOCache);
		}
		else
		{
			UE_LOG(LogVulkanRHI, Log, TEXT("FVulkanPipelineStateCacheManager will check for loading, etc when ShaderPipelineCache opens its file"));