Advertisement

depth/stencil attachment(s) of the swapchain framebuffers

Started by March 28, 2019 12:36 PM
0 comments, last by Hassanbasil 5 years, 10 months ago

Hello,

I'm modifying my little engine so that I can utilize the time the GPU takes to complete renders by creating the command buffer(s) for the next frame(s). In the process, I came across my swapchain's framebuffer creation, where I would create multiple frame buffers with distinct color attachments (one per swapchain image) and one depth/stencil attachment for all the frame buffers. This was taken from the Vulkan samples.

I found a github issue/question where the author clarified that the Vulkan examples don't use multiple threads to render and hence it was ok to share the depth/stencil image across all the swapchain framebuffers. I see that in the example code, VkQueueWaitIdle is called after presenting, so I assume the examples, by design, will never have two framebuffers being rendered to at the same time.

So I want to make sure that that is the case: if I'm going to buffer all my resources and allow the next frame's command buffer to be built while the GPU is still rendering the current frame, I will need to assign a different depth/stencil image to each framebuffer. Is that correct?

This topic is closed to new replies.

Advertisement