Rotartsi
Rotartsi

Reputation: 567

Can the number of images in the swapchain change when it is recreated?

While following the vulkan tutorial at https://vulkan-tutorial.com, I came across the line

The descriptor pool should be destroyed when the swap chain is recreated because it depends on the number of images...

In the chapter on UBOs. Is it possible for the number of images in the swapchain to change when it is recreated?

Adding to my confusion, the tutorial uses a fence for each image, but the list of fences isn't recreated when the swapchain is recreated!

Upvotes: 2

Views: 932

Answers (1)

krOoze
krOoze

Reputation: 13246

It is bit of a unresolved issue if the reported count can change: https://github.com/KhronosGroup/Vulkan-Docs/issues/388

I think it does not happen in the wild under normal circumstances. Though being unresolved in the spec means some driver maker could claim it is valid. Probably best to program defensivively here.

One thing that is technically allowed to change is the count that vkCreateSwapchain creates:

minImageCount is the minimum number of presentable images that the application needs. The implementation will either create the swapchain with at least that many images, or it will fail to create the swapchain.

Tutorial makers are only people too. I believe there's discussion at the end of each lesson where you can contact the author and ask him to clarify what he meant by his code.

Upvotes: 2

Related Questions