nvk: Don't disable non-texturable formats

We're about to add int64 formats and those aren't texturable but you can
use them as storage images.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
This commit is contained in:
Faith Ekstrand 2023-12-04 21:12:58 -06:00 committed by Marge Bot
parent 7f1dc665ef
commit 0ad77cbf98

View file

@ -26,17 +26,14 @@ nvk_get_image_plane_format_features(struct nvk_physical_device *pdev,
if (p_format == PIPE_FORMAT_NONE)
return 0;
if (!nil_format_supports_texturing(&pdev->info, p_format))
return 0;
/* You can't tile a non-power-of-two */
if (!util_is_power_of_two_nonzero(util_format_get_blocksize(p_format)))
return 0;
features |= VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT;
features |= VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT;
features |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT;
features |= VK_FORMAT_FEATURE_2_BLIT_SRC_BIT;
if (nil_format_supports_texturing(&pdev->info, p_format)) {
features |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT;
features |= VK_FORMAT_FEATURE_2_BLIT_SRC_BIT;
}
if (nil_format_supports_filtering(&pdev->info, p_format)) {
features |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT;
@ -75,6 +72,11 @@ nvk_get_image_plane_format_features(struct nvk_physical_device *pdev,
if (p_format == PIPE_FORMAT_R32_UINT || p_format == PIPE_FORMAT_R32_SINT)
features |= VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT;
if (features != 0) {
features |= VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT;
features |= VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT;
}
return features;
}