Validation for VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912 is not correct according to the Vulkan spec. #5671
Description
Environment:
- OS: Windows 10
- GPU: RTX 3070ti
- SDK or header version if building from repo: Vulkan SDK 1.3.243.0
- Options enabled (synchronization, best practices, etc.):
Describe the Issue
VVL error introduced in this PR is not correct according to the Vulkan spec. The spec says (source):
An application may open a debug label region in one command buffer and close it in another, or otherwise split debug label regions across multiple command buffers or multiple queue submissions. When viewed from the linear series of submissions to a single queue, the calls to vkCmdBeginDebugUtilsLabelEXT and vkCmdEndDebugUtilsLabelEXT must be matched and balanced.
This validation check implemented here checks for matching debug labels per command buffer while it should check per queue. There's an exception for secondary command buffers (source):
VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01913
If commandBuffer is a secondary command buffer, there must be an outstanding vkCmdBeginDebugUtilsLabelEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdEndDebugUtilsLabelEXT
In that case checking for matching debug labels makes sense per secondary command buffer.
Steps to reproduce
- Download and install Unity 2022.2.4f1 or above (e.g. https://unity.com/releases/editor/whats-new/2022.2.15)
- Install VVL that has this PR landed
- Launch Unity with any project
- Switch Graphics API to Vulkan (https://docs.unity3d.com/Manual/GraphicsAPIs.html)
- Launch Unity again with
--force-vulkan-layers
argument from CLI. - Observe
VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912
get logged in the Unity console.
Expected behavior
VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912 gets validated per queue
VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01913 gets validated per secondary command buffer
Valid Usage ID
VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912