2021 — Vkgetphysicaldevicefeatures2
For those diving deeper into engine development, resources like the Vulkan Learning Journey on GameDev.net and the official Vulkan documentation offer excellent context on how these functions integrate into a full rendering pipeline. Unheard Engine: 2 months Journey of Vulkan Learning
The power lies within the VkPhysicalDeviceFeatures2 structure:
The main downside to this command is the boilerplate code required to use it correctly. Because Vulkan requires strict type safety via sType , querying for multiple features requires the developer to manually construct a linked list of structs in memory. vkgetphysicaldevicefeatures2
Because it uses a linked list of structures, the API can support any number of future hardware features without changing the function signature.
In Vulkan 1.0, developers relied on vkGetPhysicalDeviceFeatures . While functional, it returned a fixed VkPhysicalDeviceFeatures struct. As the Khronos Group introduced new hardware features—like ray tracing, mesh shaders, or variable rate shading—this fixed structure became a bottleneck. There was no clean way to append new features without breaking the existing API. For those diving deeper into engine development, resources
To check for modern features, you "anchor" the specific feature structs you care about to the pNext pointer of your base VkPhysicalDeviceFeatures2 object. Example: Querying Ray Tracing and 16-bit Storage
: New feature structures can be defined without changing the function signature. Drivers ignore unrecognized structure types in the chain (with appropriate sType ), allowing your application to query features that may or may not be supported without recompilation. Because it uses a linked list of structures,
Starting with Vulkan 1.1, vkGetPhysicalDeviceFeatures2 is guaranteed to be supported as a core function.
In Vulkan 1.0, developers were limited to the fixed VkPhysicalDeviceFeatures structure, which could not easily accommodate new features added by extensions.
Developers should be cautious when the Vulkan API version is 1.1 or higher but the underlying GPU driver is older. In some cases, calling vkGetPhysicalDeviceFeatures2 on such a system can cause a crash , requiring a fallback or check for driver compatibility.