v3dv: don't expose image load/store features for linear images

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>
This commit is contained in:
Iago Toral Quiroga
2022-03-15 09:44:27 +01:00
committed by Marge Bot
parent 0590ce1362
commit 5a11a2fb6c

View File

@@ -181,15 +181,17 @@ image_format_features(struct v3dv_physical_device *pdevice,
vk_format_description(vk_format); vk_format_description(vk_format);
assert(desc); assert(desc);
if (desc->layout == UTIL_FORMAT_LAYOUT_PLAIN && desc->is_array) { if (tiling != VK_IMAGE_TILING_LINEAR) {
flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT; if (desc->layout == UTIL_FORMAT_LAYOUT_PLAIN && desc->is_array) {
if (desc->nr_channels == 1 && vk_format_is_int(vk_format)) flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT; if (desc->nr_channels == 1 && vk_format_is_int(vk_format))
} else if (vk_format == VK_FORMAT_A2B10G10R10_UNORM_PACK32 || flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT;
vk_format == VK_FORMAT_A2B10G10R10_UINT_PACK32 || } else if (vk_format == VK_FORMAT_A2B10G10R10_UNORM_PACK32 ||
vk_format == VK_FORMAT_B10G11R11_UFLOAT_PACK32) { vk_format == VK_FORMAT_A2B10G10R10_UINT_PACK32 ||
/* To comply with shaderStorageImageExtendedFormats */ vk_format == VK_FORMAT_B10G11R11_UFLOAT_PACK32) {
flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT; /* To comply with shaderStorageImageExtendedFormats */
flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
}
} }
if (flags) { if (flags) {