radv: expose disjoint image support

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16510>
This commit is contained in:
Benjamin Cheng 2022-05-13 21:24:12 -04:00 committed by Marge Bot
parent 27a24cb382
commit 1c06565026
1 changed files with 8 additions and 1 deletions

View File

@ -713,7 +713,8 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical
return;
}
if (vk_format_get_plane_count(format) > 1 || desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED) {
const bool multiplanar = vk_format_get_plane_count(format) > 1;
if (multiplanar || desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED) {
uint64_t tiling = VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT |
VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT |
VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT |
@ -725,6 +726,9 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical
tiling |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT;
}
if (multiplanar)
tiling |= VK_FORMAT_FEATURE_2_DISJOINT_BIT;
/* Fails for unknown reasons with linear tiling & subsampled formats. */
out_properties->linearTilingFeatures =
desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED ? 0 : tiling;
@ -1208,6 +1212,9 @@ radv_get_modifier_flags(struct radv_physical_device *dev, VkFormat format, uint6
else
features = props->optimalTilingFeatures;
/* Unconditionally disable DISJOINT support for modifiers for now */
features &= ~VK_FORMAT_FEATURE_2_DISJOINT_BIT;
if (ac_modifier_has_dcc(modifier)) {
/* Only disable support for STORAGE_IMAGE on modifiers that
* do not support DCC image stores.