Vkgetphysicaldevicefeatures2 -
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
vkGetPhysicalDeviceFeatures2 is the core infrastructure command in Vulkan used to query the capabilities of a physical device (GPU). It serves as the direct successor to the original vkGetPhysicalDeviceFeatures (from Vulkan 1.0). vkgetphysicaldevicefeatures2
vkGetPhysicalDeviceFeatures2 is a masterpiece of API design regarding extensibility. It solved the "static struct" problem inherent in C APIs. While it introduces verbosity due to the manual management of the pNext chain, the flexibility it provides is essential for a low-level, cross-vendor API like Vulkan. To check for modern features, you "anchor" the
vkGetPhysicalDeviceFeatures2 (exposed as VK_VERSION_1_1 or VK_KHR_get_physical_device_properties2 ) solves these issues by adopting the . The function takes a VkPhysicalDeviceFeatures2 structure, which contains a VkPhysicalDeviceFeatures base member and a pNext field. You append additional feature structures (e.g., VkPhysicalDeviceVulkan12Features ) to the chain. The driver fills in all supported features in one call. This offers three critical advantages: VkPhysicalDeviceVulkan12Features ) to the chain.