Reputation: 4443
I am struggling to understand why in the LunarG tutorial they make use of VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT
for the wait semaphore in queue submission. See section 15 of the tutorial.
They also show an example of use as wait stage for a barrier.
My problem with telling Vulkan to wait on the semaphore at the end of the pipeline it is that it seems to allow execution of all stages; while in fact since the framebuffer is not ready, you really should not do anything else beyond vertex shading.
See also this answer to another question, which seems to agree that VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT
does not make sense for the second synchronization context (and similarly VK_PIPELINE_STAGE_TOP_OF_PIPE
does not make sense for the first synchronization context).
Upvotes: 1
Views: 1501
Reputation: 1566
Thanks for pointing out this problem. We've updated the tutorial and the update will appear on the LunarXchange website no later than the next SDK release. edit: fix spelling.
Upvotes: 2
Reputation: 6787
You're right, using VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT
as the wait stage for the wait semaphore is wrong. It should be VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
or earlier, so that the layout transition (from VK_IMAGE_LAYOUT_UNDEFINED
to VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
at the beginning of the renderpass) and write to the fragment color outputs are blocked until the semaphore is signaled.
Upvotes: 3