What's the overhead when enable some extensions that are not used later

Hi, I’m practice writing a safe wrapper for Vulkan SDK, and it will do validation checks like the validation layers, currently, I come across this problem:

When I encapsulate the function vkGetPhysicalDeviceSurfaceCapabilities2KHR(), the validation layer said I didn’t enable the VK_KHR_get_surface_capabilities2 extension, so I decide to enable it by default (if the device support the extension, of-cause) no matter the user use it or not.

And there are other similar problems, so I wondered if there’s any overhead or disadvantage to enable an extension that will not use later?

P.S. I didn’t find this requirement in the spec, but validation layer said so, how can I not miss rules like these in later development?

Maintenance extensions like VK_KHR_get_surface_capabilities2 should not really incur significant overhead. Heavyhanded extensions like raytracing or mesh shading could. E.g. they would need to keep a shader compiler specific to them loaded and ready at all times.

P.S. I didn’t find this requirement in the spec, but validation layer said so, how can I not miss rules like these in later development?

The specification always says which extension is needed, e.g.:

// Provided by VK_KHR_get_surface_capabilities2
VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR(

Also if it is an extension, all commands from it must be manually loaded, so you need to be aware when using extension functionality at all times.

1 Like

So the that is what the comment means, I didn’t notice it before, thanks for helping.