r.Vulkan.PipelineCacheLoad

r.Vulkan.PipelineCacheLoad

#Overview

name: r.Vulkan.PipelineCacheLoad

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.PipelineCacheLoad is to control the loading of the Vulkan pipeline cache. It is a setting variable used in the Vulkan rendering system of Unreal Engine 5.

This setting variable is primarily used in the VulkanRHI (Vulkan Rendering Hardware Interface) module of Unreal Engine. Based on the callsites, it’s specifically utilized in the pipeline state cache management system within the Vulkan renderer.

The value of this variable is set through a console variable (CVar) system. It’s defined with a default value of 1, meaning pipeline cache loading is enabled by default.

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

Developers must be aware that:

  1. Setting this variable to 0 will disable the loading of the pipeline cache.
  2. Setting it to 1 (default) enables the use of the pipeline cache.

Best practices when using this variable include:

  1. Keep it enabled (set to 1) in most cases, as pipeline caches can significantly improve performance by reducing pipeline compilation time.
  2. Only disable it (set to 0) for debugging purposes or if encountering specific issues related to pipeline caches.

Regarding the associated variable GEnablePipelineCacheLoadCvar:

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> GEnablePipelineCacheLoadCvar(
	TEXT("r.Vulkan.PipelineCacheLoad"),
	1,
	TEXT("0 to disable loading the pipeline cache")
	TEXT("1 to enable using pipeline cache")
);

static TAutoConsoleVariable<int32> GPipelineCacheFromShaderPipelineCacheCvar(

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:



static TAutoConsoleVariable<int32> GEnablePipelineCacheLoadCvar(
	TEXT("r.Vulkan.PipelineCacheLoad"),
	1,
	TEXT("0 to disable loading the pipeline cache")
	TEXT("1 to enable using pipeline cache")
);

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

Scope (from outer to inner):

file
function     void FVulkanPipelineStateCacheManager::InitAndLoad

Source code excerpt:

void FVulkanPipelineStateCacheManager::InitAndLoad(const TArray<FString>& CacheFilenames)
{
	if (GEnablePipelineCacheLoadCvar.GetValueOnAnyThread() == 0)
	{
		UE_LOG(LogVulkanRHI, Display, TEXT("Not loading pipeline cache per r.Vulkan.PipelineCacheLoad=0"));
	}
	else
	{
		if (GPipelineCacheFromShaderPipelineCacheCvar.GetValueOnAnyThread() == 0)