Vulkan validation layer in UE4 is not enabled by default. We can see the codes in VulkanLayers.cpp
around line 300:
1 | const int32 VulkanValidationOption = GValidationCvar.GetValueOnAnyThread(); |
The validation layer will be enabled only if VulkanValidationOption
has a proper non-zero value when creating VkInstance
. The GValidationCvar is defined at the begining of the same file like this:
1 | TAutoConsoleVariable<int32> GValidationCvar( |
We have several options of validation level, and the default value is 0.
Of course we can assign a new value to GValidationCvar. But make sure it is setted before creating ‘VKInstance’.
Another safe way to do this is add startup argument ‘vulkanvalidation=(xxx)’ to your project or UE4 project property. You don’t even need to modify any codes by this way.
For any problems about this article, feel free to rise an issue to me. Issue |
If this article is usful for you, welcome to follow my github. Follow @gcmiao |