Extension and Feature are very confusing

Features are very confusing in vulkan

I guess a device extension has many features inside

and VkPhysicalDeviceFeatures, VkPhysicalDeviceVulkan11Features, VkPhysicalDeviceVulkan12Features, VkPhysicalDeviceVulkan13Features, VkPhysicalDeviceVulkan14Features are main feature variables given by Vulkan

however, when writing vkdevicecreateinfo,

there is pNext member

according to vulkan spec documents

there are so many struct which can be connected to this pNext

such as

VkDeviceDeviceMemoryReportCreateInfoEXT

VkDeviceDiagnosticsConfigCreateInfoNV

VkDeviceGroupDeviceCreateInfo

VkPhysicalDeviceBufferDeviceAddressFeatures

VkPhysicalDeviceDeviceAddressCommandsFeaturesKHR

VkPhysicalDeviceDeviceMemoryReportFeaturesEXT etc …

These are also features given by Vulkan

Then why does Khronos not give precise definitions about Vulkan features ?

What are those so many feature structs ?

What are the rules to find which feature structs are needed for my vulkan programming ?

How do I know that?

Please help me with this issue

Thank you

Enabling features in of itself should™️ideally change nothing, except the driver could use more resources. (And of course make valid doing something that would not be valid otherwise)

Many Features are just counterparts to Spir-V Capability. When requiring capability in shader, relevant feature should be enabled.

Otherwisely, feature is oftentimes proxy for the whole extension, and allows\forbids using mostly everything in that extension. This should be largely covered by Valid Usage blocks forbidding you doing something.

When extension gets promoted to core, this still largely applies. The few features that didn’t start as extensions are generally mentioned in the Core Revisions chapter. Features might occasionally be merged into VkPhysicalDeviceVulkan1XFeaturesstruct, but that should usually be identical thing.

If it seems overwhelming, you can open only the specification with older stuff or without extensions at https://registry.khronos.org/vulkan/specs/. With some effort one can also build specification containing only specific extensions. This pancake getting bigger for Khronos itself to eat, such spec editions might still occasionally reference things outside of their scope.

Hello, KrOoze.

Thank you for your help

However, for example, for dynamic rendering local read,

Sascha’s tutorial says we need three features to enable

VkPhysicalDeviceDynamicRenderingFeaturesKHR
VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
VkPhysicalDeviceSynchronization2FeaturesKHR

But if I don’t study that tutorial,

how can I find out I actually need those 3 features above?

The Spec document doesn’t say anything about it

I wonder

By thinking from first principles. How do you know you need a hammer or a spoon?

You study the features one by one, and either they seem they might be useful tool to you or they are not.

VkPhysicalDeviceDynamicRenderingFeaturesKHR is proxy for VK_KHR_dynamic_rendering extension. Checkout brief on what it does e.g. here.

VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR is a proxy for VK_KHR_dynamic_rendering_local_read extension. A brief for that is here.

VkPhysicalDeviceSynchronization2FeaturesKHR is a proxy for VK_KHR_synchronization2 extension. Some changes in that one to 1.0 sync. Primarily it fixes stuff by permitting more than 31 pipeline stages and access flags (lack of forwards thinking in 1.0).

So, I need to find out required features from the spec for the device extension

That will be the principle

OK, now I understand and figured out

Thank you for all your guide and kindness

Have a great weekend and see you, KrOoze

Hello, KrOoze
May I ask you one more question?

This page shows all extension features

Vulkan Feature Descriptions :: Vulkan Documentation Project

So may I think this page has all Vulkan features available?

But I read more about Spec document,

that is not actually true

There are more features

Vulkan Reference Pages :: Vulkan Documentation Project

Finally I have conclusion

Features are those which are input to pNext of VkDeviceCreateInfo and whose name has Features inside