r.Vulkan.AllowHostQueryReset
r.Vulkan.AllowHostQueryReset
#Overview
name: r.Vulkan.AllowHostQueryReset
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0: Do not enable support for Host Query Reset extension\n1: Enable Host Query Reset (default)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Vulkan.AllowHostQueryReset is to control the support for the Vulkan Host Query Reset extension in the Unreal Engine’s Vulkan RHI (Render Hardware Interface) implementation.
This setting variable is primarily used in the Vulkan RHI subsystem of Unreal Engine 5. It specifically relates to the Vulkan extension VK_EXT_HOST_QUERY_RESET, which allows resetting queries from the host (CPU) side without needing to submit commands to the GPU.
The value of this variable is set through a console variable (CVar) named GVulkanAllowHostQueryResetCVar. It’s defined with a default value of 1, meaning the Host Query Reset feature is enabled by default.
The associated variable GVulkanAllowHostQueryResetCVar interacts directly with r.Vulkan.AllowHostQueryReset. They share the same value and purpose.
Developers should be aware that:
- This is a read-only variable (ECVF_ReadOnly), meaning it can’t be changed at runtime.
- It’s a boolean-like integer where 0 disables the feature and any non-zero value enables it.
- Changing this value affects the Vulkan device extension initialization.
Best practices when using this variable include:
- Only disable it if you’re experiencing specific issues related to the Host Query Reset feature.
- Be aware that disabling this might impact performance in scenarios where host-side query resets are beneficial.
- If modifying, do so before engine initialization as it’s read-only at runtime.
Regarding the associated variable GVulkanAllowHostQueryResetCVar:
- It’s purpose is identical to r.Vulkan.AllowHostQueryReset.
- It’s used in the FVulkanEXTHostQueryResetExtension class to determine whether the extension should be enabled.
- The value is checked during the initialization of the Vulkan device extensions.
- It affects the bEnabledInCode member of the extension class, which determines if the extension is actually used.
- Developers should treat it as they would r.Vulkan.AllowHostQueryReset, as they are effectively the same setting.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanExtensions.cpp:52
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> GVulkanAllowHostQueryResetCVar(
TEXT("r.Vulkan.AllowHostQueryReset"),
1,
TEXT("0: Do not enable support for Host Query Reset extension\n")
TEXT("1: Enable Host Query Reset (default)"),
ECVF_ReadOnly
);
#Associated Variable and Callsites
This variable is associated with another variable named GVulkanAllowHostQueryResetCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanExtensions.cpp:51
Scope: file
Source code excerpt:
);
TAutoConsoleVariable<int32> GVulkanAllowHostQueryResetCVar(
TEXT("r.Vulkan.AllowHostQueryReset"),
1,
TEXT("0: Do not enable support for Host Query Reset extension\n")
TEXT("1: Enable Host Query Reset (default)"),
ECVF_ReadOnly
);
#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanExtensions.cpp:993
Scope (from outer to inner):
file
class class FVulkanEXTHostQueryResetExtension : public FVulkanDeviceExtension
function FVulkanEXTHostQueryResetExtension
Source code excerpt:
: FVulkanDeviceExtension(InDevice, VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME, VULKAN_EXTENSION_ENABLED, VK_API_VERSION_1_2)
{
bEnabledInCode = bEnabledInCode && (GVulkanAllowHostQueryResetCVar.GetValueOnAnyThread() != 0);
}
virtual void PrePhysicalDeviceFeatures(VkPhysicalDeviceFeatures2KHR& PhysicalDeviceFeatures2) override final
{
ZeroVulkanStruct(HostQueryResetFeatures, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES);
AddToPNext(PhysicalDeviceFeatures2, HostQueryResetFeatures);