When creating a Vulkan render pass with multiple subpasses, if the pResolveAttachments element of a VkSubpassDescription is non-NULL and uses VK_ATTACHMENT_UNUSED, the driver will crash when trying to create a framebuffer for that render pass with vkCreateFramebuffer().
For one of my testers, I had the following render pass configuration (indices are 1-based to work with the list numbers):
Attachments:
- window's render surface
- color buffer
- depth buffer
- color buffer
- depth buffer
- color buffer
- depth buffer
Subpasses:
- Color attachment 2 and depth attachment 3. (renders the red channel)
- Color attachment 4 and depth attachment 5. (renders the green channel)
- Color attachment 6 and depth attachment 7. (renders the blue channel)
- Color attachment 0 and no depth attachment. Takes color attachments 2, 4, and 6 as inputs. (combines the 3 channels to the final image)
In all cases, pResolveAttachments is non-NULL and uses VK_ATTACHMENT_UNUSED to indicate that there's no resolve. When calling vkCreateFramebuffer() to create the framebuffer for the render pass it crashes, but if I instead pass NULL for pResolveAttachments it works as expected. This tester has run on multiple other platforms without issue.
In this example it's equivalent to pass NULL as using VK_ATTACHMENT_UNUSED, however I'd imagine that if you're drawing to multiple color targets at once and some are resolved while others aren't it would be impossible to avoid the crash.