KhronosGroup / Vulkan-ValidationLayers

Vulkan Validation Layers (VVL)
https://vulkan.lunarg.com/doc/sdk/latest/linux/khronos_validation_layer.html
Other
770 stars 406 forks source link

Validation layers give VU error when creating protected swapchain on devices that don't support VK_KHR_surface_protected_capabilities #4692

Open jbauman42 opened 2 years ago

jbauman42 commented 2 years ago

Describe the Issue When doing vkCreateSwapchainKHR with VK_SWAPCHAIN_PROTECTED_BIT_KHR set on a Vulkan instance that doesn't support VK_KHR_surface_protected_capabilities, the layers will always log error VUID-VkSwapchainCreateInfoKHR-flags-03187. This is incorrect, since that VUID was added to the spec in VK_KHR_surface_protected_capabilities; before that, there was no such restriction on VK_SWAPCHAIN_PROTECTED_BIT_KHR.

Valid Usage ID VUID-VkSwapchainCreateInfoKHR-flags-03187

Environment:

Additional context

spencer-lunarg commented 2 years ago

Agree that VUID-VkSwapchainCreateInfoKHR-flags-03187 should not be given if VK_KHR_surface_protected_capabilities is there. I think it would be a good best practice to have a warning if the user uses VK_SWAPCHAIN_PROTECTED_BIT_KHR without VK_KHR_surface_protected_capabilities IF the extension is available