panvk: don't report features for image formats that are only usable as vertex buffers

Advertising SAMPLED_IMAGE_DEPTH_COMPARISON is a no-op for images that
don't have SAMPLED_IMAGE_BIT, but it's confusing and results in us
advertising a lot of formats that with only the
SAMPLE_IMAGE_DEPTH_COMPARISON feature that aren't usable for anything.

For R32_UINT and R32_SINT, the change is just a cleanup, because we
always support these for storage images.

Whe we implement VK_EXT_host_image_copy, advertising unusable formats
triggers failures in dEQP-VK.api.image_clearing.*, so it's convenient to
have features==0 for all unusable formats.

Fixes: 70b8056df1 ("panvk: Enable KHR_format_feature_flags2 and use them")
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35910>
This commit is contained in:
Olivia Lee 2025-07-07 10:23:30 -07:00 committed by Marge Bot
parent 00a6e284c8
commit 4f8d0e81c4

View file

@ -553,6 +553,9 @@ get_image_plane_format_features(struct panvk_physical_device *physical_device,
features |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT;
features |= VK_FORMAT_FEATURE_2_BLIT_SRC_BIT;
if (vk_format_has_depth(format))
features |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT;
}
if (fmt.bind & PAN_BIND_RENDER_TARGET) {
@ -569,20 +572,17 @@ get_image_plane_format_features(struct panvk_physical_device *physical_device,
}
}
if (fmt.bind & PAN_BIND_STORAGE_IMAGE)
if (fmt.bind & PAN_BIND_STORAGE_IMAGE) {
features |= VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT |
VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT |
VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT;
if (pfmt == PIPE_FORMAT_R32_UINT || pfmt == PIPE_FORMAT_R32_SINT)
features |= VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT;
if (pfmt == PIPE_FORMAT_R32_UINT || pfmt == PIPE_FORMAT_R32_SINT)
features |= VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT;
}
if (fmt.bind & PAN_BIND_DEPTH_STENCIL)
features |= VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT;
if (vk_format_has_depth(format))
features |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT;
return features;
}