subpass.pColorAttachments = color_refs;
subpass.pDepthStencilAttachment = &depth_stencil_ref;
+ VkSubpassDependency dependency = { };
VkRenderPassCreateInfo render_pass_info = { };
render_pass_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
render_pass_info.attachmentCount = format.size();
render_pass_info.subpassCount = 1;
render_pass_info.pSubpasses = &subpass;
+ if(to_present)
+ {
+ dependency.srcSubpass = 0;
+ dependency.dstSubpass = VK_SUBPASS_EXTERNAL;
+ dependency.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
+ dependency.srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT;
+ dependency.dstStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
+ dependency.dstAccessMask = 0;
+
+ render_pass_info.dependencyCount = 1;
+ render_pass_info.pDependencies = &dependency;
+ }
+
VkRenderPass render_pass;
vk.CreateRenderPass(render_pass_info, render_pass);