Jump to content
  • Advertisement
Sign in to follow this  
Hassanbasil

Vulkan depth/stencil attachment(s) of the swapchain framebuffers

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!