tu: add format feature flag checks for VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT

In tu_get_image_format_properties(), image usage flags are matched against
sets of required format feature flags for the specified image format.
These mappings are defined in the Vulkan 1.3 spec in section 49.3.3.,
"Format Feature Dependent Usage Flags".

Handling for the VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT flag was missing. When
specified, at least one of color attachment or depth-stencil attachment
format feature flags should be present for the given format.

Fixes 110 new Vulkan CTS tests:
 - dEQP-VK.api.info.unsupported_image_usage.linear.*
 - dEQP-VK.api.info.unsupported_image_usage.optimal.*

Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30013>
This commit is contained in:
Zan Dobersek
2024-07-03 11:20:27 +02:00
committed by Marge Bot
parent 9b2aebebac
commit 968163524a

View File

@@ -634,6 +634,14 @@ tu_get_image_format_properties(
}
}
if (image_usage & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) {
if (!(format_feature_flags &
(VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))) {
return tu_image_unsupported_format(pImageFormatProperties);
}
}
*pImageFormatProperties = (VkImageFormatProperties) {
.maxExtent = maxExtent,
.maxMipLevels = maxMipLevels,