Mesa (main): anv: Use the common wrapper for GetPhysicalDeviceFormatProperties
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Oct 11 16:53:20 UTC 2021
Module: Mesa
Branch: main
Commit: 35315c68a574505a5b2cecaa64612fb8cffa8515
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=35315c68a574505a5b2cecaa64612fb8cffa8515
Author: Jason Ekstrand <jason at jlekstrand.net>
Date: Thu Oct 7 12:30:52 2021 -0500
anv: Use the common wrapper for GetPhysicalDeviceFormatProperties
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13198>
---
src/intel/vulkan/anv_formats.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 6c9d766826e..a9f18088357 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -866,16 +866,18 @@ get_drm_format_modifier_properties_list(const struct anv_physical_device *physic
}
}
-void anv_GetPhysicalDeviceFormatProperties(
+void anv_GetPhysicalDeviceFormatProperties2(
VkPhysicalDevice physicalDevice,
VkFormat vk_format,
- VkFormatProperties* pFormatProperties)
+ VkFormatProperties2* pFormatProperties)
{
ANV_FROM_HANDLE(anv_physical_device, physical_device, physicalDevice);
const struct intel_device_info *devinfo = &physical_device->info;
const struct anv_format *anv_format = anv_get_format(vk_format);
- *pFormatProperties = (VkFormatProperties) {
+ assert(pFormatProperties->sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2);
+
+ pFormatProperties->formatProperties = (VkFormatProperties) {
.linearTilingFeatures =
anv_get_image_format_features(devinfo, vk_format, anv_format,
VK_IMAGE_TILING_LINEAR, NULL),
@@ -885,22 +887,12 @@ void anv_GetPhysicalDeviceFormatProperties(
.bufferFeatures =
get_buffer_format_features(devinfo, vk_format, anv_format),
};
-}
-
-void anv_GetPhysicalDeviceFormatProperties2(
- VkPhysicalDevice physicalDevice,
- VkFormat format,
- VkFormatProperties2* pFormatProperties)
-{
- ANV_FROM_HANDLE(anv_physical_device, physical_device, physicalDevice);
- anv_GetPhysicalDeviceFormatProperties(physicalDevice, format,
- &pFormatProperties->formatProperties);
vk_foreach_struct(ext, pFormatProperties->pNext) {
/* Use unsigned since some cases are not in the VkStructureType enum. */
switch ((unsigned)ext->sType) {
case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT:
- get_drm_format_modifier_properties_list(physical_device, format,
+ get_drm_format_modifier_properties_list(physical_device, vk_format,
(void *)ext);
break;
default:
More information about the mesa-commit
mailing list