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:
@@ -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;
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user