zink: use vkGetPhysicalDeviceFormatProperties2 when available

technically shouldn't matter but whatever

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9984>
This commit is contained in:
Mike Blumenkrantz 2021-02-03 15:30:27 -05:00 committed by Marge Bot
parent 3fa7ce4d46
commit 733e07565f
3 changed files with 9 additions and 2 deletions

View file

@ -43,7 +43,7 @@ import sys
EXTENSIONS = [
Extension("VK_EXT_debug_utils"),
Extension("VK_KHR_get_physical_device_properties2",
functions=["GetPhysicalDeviceFeatures2", "GetPhysicalDeviceProperties2"]),
functions=["GetPhysicalDeviceFeatures2", "GetPhysicalDeviceProperties2", "GetPhysicalDeviceFormatProperties2"]),
Extension("VK_MVK_moltenvk",
nonstandard=True),
]

View file

@ -1310,7 +1310,13 @@ populate_format_props(struct zink_screen *screen)
VkFormat format = zink_get_format(screen, i);
if (!format)
continue;
vkGetPhysicalDeviceFormatProperties(screen->pdev, format, &screen->format_props[i]);
if (screen->vk_GetPhysicalDeviceFormatProperties2) {
VkFormatProperties2 props = {};
props.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2;
screen->vk_GetPhysicalDeviceFormatProperties2(screen->pdev, format, &props);
screen->format_props[i] = props.formatProperties;
} else
vkGetPhysicalDeviceFormatProperties(screen->pdev, format, &screen->format_props[i]);
}
}

View file

@ -104,6 +104,7 @@ struct zink_screen {
PFN_vkGetPhysicalDeviceFeatures2 vk_GetPhysicalDeviceFeatures2;
PFN_vkGetPhysicalDeviceProperties2 vk_GetPhysicalDeviceProperties2;
PFN_vkGetPhysicalDeviceFormatProperties2 vk_GetPhysicalDeviceFormatProperties2;
PFN_vkCmdDrawIndirectCount vk_CmdDrawIndirectCount;
PFN_vkCmdDrawIndexedIndirectCount vk_CmdDrawIndexedIndirectCount;