KhronosGroup/Vulkan-LoaderAndValidationLayers

vkCmdClearAttachments rect validation errors when CB->createInfo.level != VK_COMMAND_BUFFER_LEVEL_PRIMARY

lucferron opened this issue · 1 comments

There is a regression when validating vkCmdClearAttachment rects and the command buffer node isn't created with VK_COMMAND_BUFFER_LEVEL_PRIMARY.

Most likely, you will receive the following error: "vkCmdClearAttachments(): The area defined by pRects[%d] is not contained in the area of the current render pass instance.",

The rects pointer just gets passed to the lambda and won't necessarily contain the rectangle data anymore when the validation occurs later on. The rectangle needs to be copied by value to the lambda in order to make sure the right rectangle gets validated.

The change that introduced the issue is here:
185f5e0

Thank you for fixing the issue so quickly.