mirror of
https://github.com/ocornut/imgui.git
synced 2025-04-09 15:07:07 +00:00
Examples: Vulkan: Fix missing subpass dependency
Without a dependency between pWaitDstStageMask (COLOR_ATTACHMENT_OUTPUT) and the render-pass, the UNDEFINED -> COLOR_ATTACHMENT_OPTIMAL transition might happen before the image is ready to be used.
This commit is contained in:
parent
a73f6d06e0
commit
4485e56e02
1 changed files with 9 additions and 0 deletions
|
@ -142,12 +142,21 @@ static void resize_vulkan(int w, int h)
|
|||
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
|
||||
subpass.colorAttachmentCount = 1;
|
||||
subpass.pColorAttachments = &color_attachment;
|
||||
VkSubpassDependency dependency = {};
|
||||
dependency.srcSubpass = VK_SUBPASS_EXTERNAL;
|
||||
dependency.dstSubpass = 0;
|
||||
dependency.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
|
||||
dependency.dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
|
||||
dependency.srcAccessMask = 0;
|
||||
dependency.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
|
||||
VkRenderPassCreateInfo info = {};
|
||||
info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
|
||||
info.attachmentCount = 1;
|
||||
info.pAttachments = &attachment;
|
||||
info.subpassCount = 1;
|
||||
info.pSubpasses = &subpass;
|
||||
info.dependencyCount = 1;
|
||||
info.pDependencies = &dependency;
|
||||
err = vkCreateRenderPass(g_Device, &info, g_Allocator, &g_RenderPass);
|
||||
check_vk_result(err);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue