Q about an order of querying for physical device surface capabilities and the swap chain extension support

Hi! In the Vulkan Tutorial, there is a note that It is important that we only try to query for swap chain support after verifying that the extension is available., in this section: https://vulkan-tutorial.com/Drawing_a_triangle/Presentation/Swap_chain#page_Querying-details-of-swap-chain-support

While I get that querying for the surface capabilities is kinda pointless if swap chain isn’t supported, I failed to find an explicit rule about the order of these operations in the spec. Maybe I got lost in the spec and overlooked the explanation of why it’s that important? What could happen if we check surface capabilities first, and query for swap chain support after?

Do not crosspost, and see answer at https://www.reddit.com/r/vulkan/comments/dmu7vd/q_about_an_order_of_querying_for_physical_device/

1 Like

Is this still a cross-posting if the question is in a completely different place? :slight_smile:

But I get your point though, and thanks a lot for the answer. I’ll paste it here anyway, so people don’t have to click around:
Here’s the part of the spec that could be violated: khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#initialization-phys-dev-extensions

“Applications must not use a VkPhysicalDevice in any command added by an extension or core version that is not supported by that physical device.”