Closed flowerdancedatou closed 5 years ago
Hi, could you send more information on the point where this happens?
I'd assume it is related to acquiring an image from the swapchain and using it in a render pass. The problem is that the acquisition is only complete when the semaphore is signaled and the implicit transition as part of a subpass doesn't wait for that semaphore. You can ensure that the transition is correctly synchronized by adding an explicit subpass dependency.
For more details on the problem and the correct dependency to add, see here: https://github.com/ARM-software/vulkan-sdk/issues/14#issuecomment-489096767
In "https://arm-software.github.io/vulkan-sdk/hello_triangle.html".
Adding Subpass Dependency The image layout transition as part of a subpass will happen without any waiting. This is bad because the presentation engine can still be reading from the image. To properly enforce this we need to add an external dependency to our first subpass where the layout transition happens.
Hi, that confirms it was about acquiring a swapchain image. :)
You can follow the explanation in the tutorial to ensure that your explicit subpass dependency is correct.
Another approach, in case you find it simpler, is to disable the implicit dependency (i.e. set initialLayout = layout = finalLayout
) and do the layout transitions via pipeline barriers. This way you can ensure that the transition happens at the correct stage, when the image has already been acquired.
thank you very much.^_^
The image layout transition as part of a subpass will happen without any waiting. Why "This is bad because the presentation engine can still be reading from the image. "?