mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-24 00:26:36 +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
@ -142,12 +142,21 @@ static void resize_vulkan(int w, int h)
|
|||||||
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
|
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
|
||||||
subpass.colorAttachmentCount = 1;
|
subpass.colorAttachmentCount = 1;
|
||||||
subpass.pColorAttachments = &color_attachment;
|
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 = {};
|
VkRenderPassCreateInfo info = {};
|
||||||
info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
|
info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
|
||||||
info.attachmentCount = 1;
|
info.attachmentCount = 1;
|
||||||
info.pAttachments = &attachment;
|
info.pAttachments = &attachment;
|
||||||
info.subpassCount = 1;
|
info.subpassCount = 1;
|
||||||
info.pSubpasses = &subpass;
|
info.pSubpasses = &subpass;
|
||||||
|
info.dependencyCount = 1;
|
||||||
|
info.pDependencies = &dependency;
|
||||||
err = vkCreateRenderPass(g_Device, &info, g_Allocator, &g_RenderPass);
|
err = vkCreateRenderPass(g_Device, &info, g_Allocator, &g_RenderPass);
|
||||||
check_vk_result(err);
|
check_vk_result(err);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user