Vkgetphysicaldevicefeatures2 Review
vkGetPhysicalDeviceFeatures2 represents a maturation of Vulkan’s design philosophy. By replacing ad-hoc queries with an extensible, chain-based mechanism, it allows the API to grow without breaking existing code. For developers, adopting this function means writing more maintainable, future-proof applications that gracefully handle new hardware capabilities. The days of scattered feature checks and mismatched enablement are over. Embrace vkGetPhysicalDeviceFeatures2 —not just because it’s modern, but because it makes your Vulkan code robustly correct.
Furthermore, enabling features at device creation was similarly fragmented. VkDeviceCreateInfo had a pEnabledFeatures pointer, but it only pointed to the original VkPhysicalDeviceFeatures . To enable newer features, you had to chain structures into the pNext chain of VkDeviceCreateInfo . This created a disconnect: querying and enabling features used different mechanisms, and there was no guarantee that queried features matched the enabling structures. vkgetphysicaldevicefeatures2
While safe, this is verbose. Helper libraries (like Volk or C++ wrappers) often abstract this away, but in raw C, it adds significant code volume. The days of scattered feature checks and mismatched
// 1. Define the structs you care about VkPhysicalDeviceFeatures2 features2 = .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 ; VkPhysicalDeviceVulkan13Features vulkan13Features = .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES ; VkPhysicalDeviceRayTracingPipelineFeaturesKHR rtFeatures = .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR ; but in raw C