r.Vulkan.UseProfileCheck
r.Vulkan.UseProfileCheck
#Overview
name: r.Vulkan.UseProfileCheck
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0 to assume all requested feature levels are supported.\n1 to verify feature level support using a profile check (default)\n
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:
- This variable is marked as ECVF_ReadOnly, meaning it should not be changed during runtime.
- 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.
- The default value (1) is generally safer as it verifies feature level support.
Best practices when using this variable include:
- Leave it at the default value (1) unless there’s a specific reason to change it.
- If disabling the profile check, thoroughly test on target hardware to ensure all used features are actually supported.
- 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:
- Its purpose is the same as r.Vulkan.UseProfileCheck, serving as the actual console variable implementation.
- It’s used in the SupportsProfileChecks() function of the FVulkanGenericPlatform class to determine if profile checks should be performed.
- The value can be overridden by the command line parameter “-SkipVulkanProfileCheck”.
- Developers should be aware that this variable’s value is accessed using GetValueOnAnyThread(), which suggests it might be accessed from multiple threads.
- Best practices include using this variable consistently throughout the codebase when determining whether to perform Vulkan profile checks, and considering thread safety when accessing its value.
#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);