anv, hasvk: check requirements for USAGE_INPUT_ATTACHMENT properly

If the format doesn't support the COLOR_ATTACHMENT or DEPTH_STENCIL
features, it can't be used as an input attachment.

Fixes future CTS tests: dEQP-VK.api.info.unsupported_image_usage.*

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28818>
This commit is contained in:
Iván Briano
2024-04-17 15:17:00 -07:00
committed by Marge Bot
parent f3e97d30d9
commit 164c0951a0
2 changed files with 9 additions and 7 deletions
+4 -3
View File
@@ -1072,9 +1072,10 @@ anv_format_supports_usage(
}
if (usage_flags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) {
/* Ignore this flag because it was removed from the
* provisional_I_20150910 header.
*/
if (!(format_feature_flags & (VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT |
VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT))) {
return false;
}
}
return true;
+5 -4
View File
@@ -1199,10 +1199,11 @@ anv_get_image_format_properties(
/* Nothing to check. */
}
if (image_usage & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) {
/* Ignore this flag because it was removed from the
* provisional_I_20150910 header.
*/
if (view_usage & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) {
if (!(format_feature_flags & (VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT |
VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT))) {
goto unsupported;
}
}
/* From the bspec section entitled "Surface Layout and Tiling",