radv: fix format feature reporting for modifiers
authorSimon Ser <contact@emersion.fr>
Thu, 1 Apr 2021 15:06:31 +0000 (17:06 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 6 Apr 2021 09:20:26 +0000 (09:20 +0000)
The format_feature_flags bitfield is derived from the modifier if
the tiling is set to VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT.
However radv will reset the tiling to either LINEAR or OPTIMAL if
the caller supplied a VkPhysicalDeviceImageDrmFormatModifierInfoEXT
in the chain.

Stop resetting the tiling, so that we can compute the correct feature
flags.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: 6c83e3ea98b7 ("radv: Add format modifier format queries.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9978>

src/amd/vulkan/radv_formats.c

index 5d3dfd9..0ac7d02 100644 (file)
@@ -1329,11 +1329,6 @@ static VkResult radv_get_image_format_properties(struct radv_physical_device *ph
                vk_find_struct_const(info->pNext, PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT);
        VkResult result = VK_ERROR_FORMAT_NOT_SUPPORTED;
 
-       if (mod_info) {
-               tiling = mod_info->drmFormatModifier == DRM_FORMAT_MOD_LINEAR ?
-                       VK_IMAGE_TILING_LINEAR : VK_IMAGE_TILING_OPTIMAL;
-       }
-
        radv_physical_device_get_format_properties(physical_device, format,
                                                   &format_props);
        if (tiling == VK_IMAGE_TILING_LINEAR) {