r.Vulkan.UseProfileCheck

r.Vulkan.UseProfileCheck

#Overview

name: r.Vulkan.UseProfileCheck

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.UseProfileCheck is to control whether the Vulkan renderer should verify feature level support using a profile check. This setting is part of the Vulkan rendering subsystem in Unreal Engine 5.

This setting variable is primarily used by the Vulkan RHI (Rendering Hardware Interface) module, which is responsible for implementing the Vulkan rendering backend for Unreal Engine.

The value of this variable is set through a console variable (CVarVulkanUseProfileCheck) with a default value of 1. It can be modified at runtime through console commands or configuration files.

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

Developers should be aware that:

  1. This variable is marked as ECVF_ReadOnly, meaning it should not be changed during runtime.
  2. Setting this to 0 will assume all requested feature levels are supported, which may lead to issues if the hardware doesn’t actually support those features.
  3. The default value (1) is generally safer as it verifies feature level support.

Best practices when using this variable include:

  1. Leave it at the default value (1) unless there’s a specific reason to change it.
  2. If disabling the profile check, thoroughly test on target hardware to ensure all used features are actually supported.
  3. Be cautious when disabling this check in shipping builds, as it may lead to unexpected behavior on some hardware configurations.

Regarding the associated variable CVarVulkanUseProfileCheck:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanGenericPlatform.cpp:6

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarVulkanUseProfileCheck(
	TEXT("r.Vulkan.UseProfileCheck"),
	1,
	TEXT("0 to assume all requested feature levels are supported.\n")
	TEXT("1 to verify feature level support using a profile check (default)\n"),
	ECVF_ReadOnly
);

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanGenericPlatform.cpp:5

Scope: file

Source code excerpt:

#include "Misc/CommandLine.h"

static TAutoConsoleVariable<int32> CVarVulkanUseProfileCheck(
	TEXT("r.Vulkan.UseProfileCheck"),
	1,
	TEXT("0 to assume all requested feature levels are supported.\n")
	TEXT("1 to verify feature level support using a profile check (default)\n"),
	ECVF_ReadOnly
);

#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanGenericPlatform.cpp:165

Scope (from outer to inner):

file
function     bool FVulkanGenericPlatform::SupportsProfileChecks

Source code excerpt:

bool FVulkanGenericPlatform::SupportsProfileChecks()
{
	return (CVarVulkanUseProfileCheck.GetValueOnAnyThread() != 0) && 
		!FParse::Param(FCommandLine::Get(), TEXT("SkipVulkanProfileCheck"));
}

FString FVulkanGenericPlatform::GetVulkanProfileNameForFeatureLevel(ERHIFeatureLevel::Type FeatureLevel, bool bRaytracing)
{
	FString ProfileName = TEXT("VP_UE_Vulkan_") + LexToString(FeatureLevel);