-
- StructureBuilder sb(buffer, 6);
- VkRenderPassCreateInfo *const &render_pass_info = sb.add<VkRenderPassCreateInfo>();
- VkSubpassDescription *const &subpass = sb.add<VkSubpassDescription>();
- VkAttachmentDescription *const &attachments = sb.add<VkAttachmentDescription>(format.size());
- VkAttachmentReference *const &color_refs = sb.add<VkAttachmentReference>(color_count);
- VkAttachmentReference *const &depth_stencil_ref = sb.add<VkAttachmentReference>(has_depth);
- VkSubpassDependency *const &dependency = sb.add<VkSubpassDependency>(to_present);
-
- VkSampleCountFlagBits vk_samples = static_cast<VkSampleCountFlagBits>(get_vulkan_samples(format.get_samples()));
-
- VkAttachmentReference *color_ptr = color_refs;
+ bool resolve = framebuffer->has_resolve_attachments();
+
+ StructureBuilder sb(buffer, 7);
+ VkRenderPassCreateInfo2 *const &render_pass_info = sb.add<VkRenderPassCreateInfo2>();
+ VkSubpassDescription2 *const &subpass = sb.add<VkSubpassDescription2>();
+ VkAttachmentDescription2 *const &attachments = sb.add<VkAttachmentDescription2>(format.size()*(1+resolve));
+ VkAttachmentReference2 *const &color_refs = sb.add<VkAttachmentReference2>(color_count*(1+resolve));
+ VkAttachmentReference2 *const &depth_stencil_ref = sb.add<VkAttachmentReference2>(has_depth*(1+resolve));
+ VkSubpassDescriptionDepthStencilResolve *const &depth_stencil_resolve = sb.add<VkSubpassDescriptionDepthStencilResolve>(has_depth && resolve);
+ VkSubpassDependency2 *const &dependency = sb.add<VkSubpassDependency2>(to_present);
+
+ VkAttachmentReference2 *color_ptr = color_refs;
+ VkAttachmentReference2 *ds_ptr = depth_stencil_ref;