KhronosGroup / Vulkan-Samples

One stop solution for all Vulkan samples
Apache License 2.0
4.23k stars 634 forks source link

Some Vulkan API 1.0 samples fail when using Vulkan 1.1 API support functions #1123

Closed SRSaunders closed 1 month ago

SRSaunders commented 1 month ago

The Vulkan API 1.0 samples _memorybudget and _dynamicblending can fail since they use certain Vulkan 1.1 API support functions. This can be observed when running against MoltenVK which enforces the sample's configured API version.

The specific Vulkan 1.1 API support functions which are undefined and fail are: vkGetPhysicalDeviceFeatures2() vkGetPhysicalDeviceMemoryProperties2()

Instead, the Vulkan 1.0 API support functions (with VK_KHR_get_physical_device_properties2 enabled) should be: vkGetPhysicalDeviceFeatures2KHR() vkGetPhysicalDeviceMemoryProperties2KHR()

In addition, VulkanStatsProvider::is_supported() should also use vkGetPhysicalDeviceFeatures2KHR() since it is a utility which can be used with any Vulkan sample.

Other usage of vkGetPhysicalDeviceFeatures2() within the project are for samples using Vulkan API >= 1.1, where the function is properly defined.

I will submit a PR to solve.