anv: Support multiple aspects in anv_formats_ccs_e_compatible
Prevents the next patch from causing the following assert failure: Test case 'dEQP-VK.ycbcr.copy.g8_b8_r8_3plane_420_unorm.g8_b8_r8_3plane_444_unorm.linear_linear_disjoint'.. deqp-vk: ../../src/intel/vulkan/anv_private.h:4962: anv_aspect_to_plane: Assertion `!(aspect & ~all_aspects)' failed. We still disable CCS for multiplane formats elsewhere. I've attempted enabling CCS for those cases but end up with failures in CI that I cannot reproduce locally. Hopefully this change gets the next person a step closer towards enabling this feature. Reviewed-by: Rohan Garg <rohan.garg@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29094>
This commit is contained in:
@@ -511,24 +511,27 @@ anv_formats_ccs_e_compatible(const struct intel_device_info *devinfo,
|
||||
VkImageUsageFlags vk_usage,
|
||||
const VkImageFormatListCreateInfo *fmt_list)
|
||||
{
|
||||
enum isl_format format =
|
||||
anv_get_isl_format(devinfo, vk_format, VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
vk_tiling);
|
||||
u_foreach_bit(b, vk_format_aspects(vk_format)) {
|
||||
VkImageAspectFlagBits aspect = 1 << b;
|
||||
enum isl_format format =
|
||||
anv_get_isl_format(devinfo, vk_format, aspect, vk_tiling);
|
||||
|
||||
if (!formats_ccs_e_compatible(devinfo, create_flags, format, vk_tiling,
|
||||
fmt_list))
|
||||
return false;
|
||||
|
||||
if (vk_usage & VK_IMAGE_USAGE_STORAGE_BIT) {
|
||||
if (devinfo->verx10 < 125)
|
||||
if (!formats_ccs_e_compatible(devinfo, create_flags, format, vk_tiling,
|
||||
fmt_list))
|
||||
return false;
|
||||
|
||||
/* Disable compression when surface can be potentially used for atomic
|
||||
* operation.
|
||||
*/
|
||||
if (storage_image_format_supports_atomic(devinfo, create_flags, format,
|
||||
vk_tiling, fmt_list))
|
||||
return false;
|
||||
if (vk_usage & VK_IMAGE_USAGE_STORAGE_BIT) {
|
||||
if (devinfo->verx10 < 125)
|
||||
return false;
|
||||
|
||||
/* Disable compression when surface can be potentially used for
|
||||
* atomic operation.
|
||||
*/
|
||||
if (storage_image_format_supports_atomic(devinfo, create_flags,
|
||||
format, vk_tiling,
|
||||
fmt_list))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user