I have a framebuffer that was created with a renderpass with one subpass and i want to render to it with a render pass with one subpass and with another renderpass with zero subpasses(I know zero is not allowed. The validation layer yells at me. You can think its 2).
when I use vkCmdBeginRenderPass I get 2 errors:
1.
msgNum: 861854874 - Validation Error: [ VUID-VkRenderPassBeginInfo-renderPass-00904 ] Object 0: handle = 0xf56c9b0000000004, type = VK_OBJECT_TYPE_RENDER_PASS; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0x335edc9a | vkCmdBeginRenderPass: RenderPasses incompatible between render pass w/ VkRenderPass 0xf56c9b0000000004 with a subpassCount of 0 and framebuffer w/ VkRenderPass 0xfa21a40000000003 with a subpassCount of 1. The Vulkan spec states: renderPass must be compatible with the renderPass member of the VkFramebufferCreateInfo structure specified when creating framebuffer
msgNum: 861854874 - Validation Error: [ VUID-VkRenderPassBeginInfo-renderPass-00904 ] Object 0: handle = 0xf56c9b0000000004, type = VK_OBJECT_TYPE_RENDER_PASS; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0x335edc9a | vkCmdBeginRenderPass: RenderPasses incompatible between render pass w/ VkRenderPass 0xf56c9b0000000004 with a dependencyCount of 0 and framebuffer w/ VkRenderPass 0xfa21a40000000003 with a dependencyCount of 1. The Vulkan spec states: renderPass must be compatible with the renderPass member of the VkFramebufferCreateInfo structure specified when creating framebuffer.
My question is how can I render with 2 renderpasses with different number of subpasses.
It makes cense that the number of attachments needs to be the same and other properties like that but why does the number of subpasses needs to be the same and what is the right way to do this?