Commit dcdd6b6a by Tobin Ehlis Committed by Commit Bot

Vulkan:Enable Validation best practices layer

When Vulkan Validation layers are enabled, also enable the validation best practices layer which includes ARM's perfdoc layer. Initially adding skips for all of the best practices errors that are triggered so that these can be enabled by default. Bug: b/156661359 Change-Id: I7eab9710bf9632d07ff6b80375d3ad1789d58f7c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2202634 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: 's avatarTobin Ehlis <tobine@google.com> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarMohan Maiya <m.maiya@samsung.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent 8765b46a
......@@ -128,6 +128,17 @@ constexpr const char *kSkippedMessages[] = {
// https://issuetracker.google.com/issues/159493191
"VUID-vkCmdDraw-None-02690",
"VUID-vkCmdDrawIndexed-None-02690",
// Best Practices Skips issuetracker.google.com/156661359
"UNASSIGNED-BestPractices-vkCreateCommandPool-command-buffer-reset",
"UNASSIGNED-BestPractices-pipeline-stage-flags",
"UNASSIGNED-BestPractices-Error-Result",
"UNASSIGNED-BestPractices-vkAllocateMemory-small-allocation",
"UNASSIGNED-BestPractices-vkBindMemory-small-dedicated-allocation",
"UNASSIGNED-BestPractices-vkAllocateMemory-too-many-objects",
"UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension",
"UNASSIGNED-BestPractices-vkCreateRenderPass-image-requires-memory",
"UNASSIGNED-BestPractices-vkCreateGraphicsPipelines-too-many-instanced-vertex-buffers",
"UNASSIGNED-BestPractices-DrawState-ClearCmdBeforeDraw",
};
// Suppress validation errors that are known
......@@ -697,6 +708,19 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk,
enabledInstanceExtensions.empty() ? nullptr : enabledInstanceExtensions.data();
instanceInfo.enabledLayerCount = static_cast<uint32_t>(enabledInstanceLayerNames.size());
instanceInfo.ppEnabledLayerNames = enabledInstanceLayerNames.data();
if (mEnableValidationLayers)
{
// Enable best practices output which includes perfdoc layer
VkValidationFeatureEnableEXT enabledFeatures[] = {
VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT};
VkValidationFeaturesEXT validationFeatures = {};
validationFeatures.sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT;
validationFeatures.enabledValidationFeatureCount = 1;
validationFeatures.pEnabledValidationFeatures = enabledFeatures;
vk::AddToPNextChain(&instanceInfo, &validationFeatures);
}
ANGLE_VK_TRY(displayVk, vkCreateInstance(&instanceInfo, nullptr, &mInstance));
#if defined(ANGLE_SHARED_LIBVULKAN)
// Load volk if we are linking dynamically
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment