Closed SRSaunders closed 1 month ago
Shouldn't we also use VkFormatProperties2KHR
instead of VkFormatProperties2
then?
Shouldn't we also use VkFormatProperties2KHR instead of VkFormatProperties2 then?
That's a natural question, but the Vulkan Spec seems to say otherwise. See https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties2.html. Both versions of the function (API 1.1 and 1.0) reference VkFormatProperties2
, and this seems to be borne out by the header files.
However, for readability and consistency, I could make the change since the following is also true (see https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkFormatProperties2.html):
// Provided by VK_KHR_get_physical_device_properties2
typedef VkFormatProperties2 VkFormatProperties2KHR;
The current change works as is, but please let me know what you would prefer.
If we use the KHR suffix in one place, we should use it in the other places too to make it consistent.
Description
This PR replaces Vulkan 1.1 API support function
vkGetPhysicalDeviceFormatProperties2()
with Vulkan 1.0 equivalentvkGetPhysicalDeviceFormatProperties2KHR()
for Vulkan API 1.0 sample _host_imagecopy. This prevents runtime failures (undefined functions) on Vulkan drivers that enforce the specified API version.I did not up-version the sample to Vulkan API 1.1 since it appears that Vulkan API 1.0 was the intended API version, with extensions enabled by
VK_KHR_get_physical_device_properties2
.Tested on macOS Ventura and iOS 17 using both the Vulkan loader and MoltenVK standalone.
General Checklist:
Please ensure the following points are checked:
[x] This PR describes the scope and expected impact of the changes I am making
Note: The Samples CI runs a number of checks including:
If this PR contains framework changes:
batch
command line argument to make sure all samples still work properlySample Checklist
If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist: