anv/sparse: exclude Xe2's Tile64's non-standard block shapes

The Tile64 format from Xe2 is weird and some of its MSAA shapes are
non-standard. Reject them. Otherwise, we'll get dEQP failures such as:

  deqp-vk: ../../src/intel/vulkan/anv_sparse.c:829: anv_sparse_calc_image_format_properties: Assertion `is_standard || is_known_nonstandard_format' failed.

Many tests can reproduce this issue, including:

  dEQP-VK.memory.requirements.extended.image.sparse_tiling_optimal

Testcase: dEQP-VK.memory.requirements.extended.image.sparse_tiling_optimal
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27306>
This commit is contained in:
Paulo Zanoni 2024-04-23 15:26:56 -07:00 committed by Marge Bot
parent e69c7cd149
commit 8abfdfe576

View file

@ -1260,6 +1260,28 @@ anv_sparse_image_check_support(struct anv_physical_device *pdevice,
isl_layout->bpb != 32 && isl_layout->bpb != 64 &&
isl_layout->bpb != 128)
return VK_ERROR_FORMAT_NOT_SUPPORTED;
/* ISL_TILING_64_XE2_BIT's block shapes are not always Vulkan's standard
* block shapes, so exclude what's non-standard.
*/
if (pdevice->info.ver == 20) {
switch (samples) {
case VK_SAMPLE_COUNT_2_BIT:
if (isl_layout->bpb == 128)
return VK_ERROR_FORMAT_NOT_SUPPORTED;
break;
case VK_SAMPLE_COUNT_8_BIT:
if (isl_layout->bpb == 8 || isl_layout->bpb == 32)
return VK_ERROR_FORMAT_NOT_SUPPORTED;
break;
case VK_SAMPLE_COUNT_16_BIT:
if (isl_layout->bpb == 64)
return VK_ERROR_FORMAT_NOT_SUPPORTED;
break;
default:
break;
}
}
}
/* These YUV formats are considered by Vulkan to be compressed 2x1 blocks.