I know how to use input attachments and multisampling separately. But I don't understand how these 2 features can be used together.
I have render pass with 2 subpasses and 4 attachments:
- an image, which is presented;
- a multisampled image with samples=N, which is rendered and resolved (into image #1) in the second subpass;
- a multisampled depth image with samples=N, which is rendered in the both subpasses;
- a multisampled image with samples=N, which is used as color attachment in the first subpass and input attachment in the second subpass.
If N equals to VK_SAMPLE_COUNT_1_BIT, everything works fine. But if N equals to VK_SAMPLE_COUNT_4_BIT, I have a lot of errors:
- vkCreateRenderPass returns error code on Mi A1;
- vkCreateRenderPass returns success on Mi A2 lite, but I get a lot of warnings from validation layers:
Descriptor set 0x28107 encountered the following validation error at vkCmdDraw() time: Descriptor in binding #0 at global descriptor index 0 requires bound image to have VK_SAMPLE_COUNT_1_BIT but got VK_SAMPLE_COUNT_4_BIT.
Questions:
- Is it prohibited to use multisampled input attachments? I can't find anything about this in spec.
- I can resolve my image #4 in the first subpass into some other image (#5) which will be used as input attachment in the second subpass. Is it the only way to fix this problem?