mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-06-19 19:38:24 +02:00
clients/simple-vulkan: Fix renderpass subpass dependency
The renderpass implicit subpass dependency effectively waits for nothing, which can be a source of hazard for swapchain outputs. As reported by synchronization validation, the layout transition implicit in the renderpass must wait for COLOR_ATTACHMENT_OUTPUT of the preceding vkAcquireNextImageKHR. Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
This commit is contained in:
parent
70b478f13d
commit
ca44709c81
1 changed files with 10 additions and 0 deletions
|
|
@ -623,12 +623,22 @@ static void create_renderpass(struct window *window)
|
|||
.colorAttachmentCount = 1,
|
||||
.pColorAttachments = &attachment_reference,
|
||||
};
|
||||
const VkSubpassDependency subpass_dependency = {
|
||||
.srcSubpass = VK_SUBPASS_EXTERNAL,
|
||||
.dstSubpass = 0,
|
||||
.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
|
||||
.dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
|
||||
.srcAccessMask = 0,
|
||||
.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
|
||||
};
|
||||
const VkRenderPassCreateInfo renderpass_create_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
|
||||
.attachmentCount = 1,
|
||||
.pAttachments = &attachment_description,
|
||||
.subpassCount = 1,
|
||||
.pSubpasses = &subpass_description,
|
||||
.dependencyCount = 1,
|
||||
.pDependencies = &subpass_dependency,
|
||||
};
|
||||
|
||||
result = vkCreateRenderPass(window->vk.dev, &renderpass_create_info, NULL, &window->vk.renderpass);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue