KhronosGroup / Vulkan-Docs

The Vulkan API Specification and related tools
Other
2.7k stars 452 forks source link

Wrong description of VUID-vkCmdExecuteCommands-contents-06018 #2372

Closed gamagan closed 1 month ago

gamagan commented 1 month ago

Bad description of VUID VUID-vkCmdExecuteCommands-contents-06018:

VUID-vkCmdExecuteCommands-contents-06018 If vkCmdExecuteCommands is being called within a render pass instance begun with vkCmdBeginRenderPass, its contents parameter must have been set to VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS , or VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_EXT

This is only true when the vkCmdExecuteCommands is being used in the first subpass. If vkCmdExecuteCommands is being used in a non-first subpass of the given RenderPass, then the correct value for the RenderPass is VK_SUBPASS_CONTENTS_INLINE or VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_EXT

This particular VUID mistake tripped me up for a long time, because it makes it sound like it's not possible to have some subpasses made of primary command buffers, while other subpasses are made up of secondary command buffers. That is, it makes it sound like a RenderPass is either made up entirely of subpasses of primary level, or made up entirely of subpass of secondary level, but not both. In fact, it is possible to have mixed subpasses like that.

HansKristian-Work commented 1 month ago

The correct VU would be that in subpass 0, we look at vkCmdBeginRenderPass as stated, in subpass 1+ we look at the parameter in vkCmdNextSubpass. I'll look into a spec fix.

oddhack commented 1 month ago

This should be fixed in the 1.3.287 spec update.

spencer-lunarg commented 3 weeks ago

validation fix - https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/8131