Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0715b61

Browse files
committed
Add description of alternative way to handle semaphore/subpass interaction
1 parent d16a7bd commit 0715b61

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

03_Drawing_a_triangle/03_Drawing/02_Rendering_and_presentation.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,13 @@ subpass also count as implicit "subpasses".
204204
There are two built-in dependencies that take care of the transition at the
205205
start of the render pass and at the end of the render pass, but the former does
206206
not occur at the right time. It assumes that the transition occurs at the start
207-
of the pipeline, but we haven't acquired the image yet at that point! The image
208-
is not ready until the `VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT` stage.
209-
Therefore we need to override this dependency with our own dependency.
207+
of the pipeline, but we haven't acquired the image yet at that point! There are
208+
two ways to deal with this problem. We could change the `waitStages` for the
209+
`imageAvailableSemaphore` to `VK_PIPELINE_STAGE_TOP_OF_PIPELINE_BIT` to ensure
210+
that the render passes don't begin until the image is available, or we can make
211+
the render pass wait for the `VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT`
212+
stage. I've decided to go with the second option here, because it's a good
213+
excuse to have a look at subpass dependencies and how they work.
210214

211215
Subpass dependencies are specified in `VkSubpassDependency` structs. Go to the
212216
`createRenderPass` function and add one:

0 commit comments

Comments
 (0)