From 8abfdfe576be130667eed08da3e3d71a06be579a Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Tue, 23 Apr 2024 15:26:56 -0700 Subject: [PATCH] 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 Signed-off-by: Paulo Zanoni Part-of: --- src/intel/vulkan/anv_sparse.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/intel/vulkan/anv_sparse.c b/src/intel/vulkan/anv_sparse.c index 66e1de969a2..ea5263d2cce 100644 --- a/src/intel/vulkan/anv_sparse.c +++ b/src/intel/vulkan/anv_sparse.c @@ -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.