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:
Erico Nunes 2026-05-26 12:53:46 +02:00
parent 70b478f13d
commit ca44709c81

View file

@ -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);