From fe372f3b1bfaa2908fbfc18ad702fe8cd19490a6 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Mon, 8 Dec 2025 13:09:14 -0500 Subject: [PATCH] anv: Don't allow STORAGE + CCS for Y_TILED mod This can happen as a result of us adding on CCS to modifiers which don't support it on gfx9-11. Fixes image corruption seen with the following test: $ mpv av://lavfi:testsrc --config=no --vo=gpu-next --scale=ewa_lanczossharp --fs Fixes: 01c4ea771cd ("anv: Enable storage accesses with modifiers on gfx12+") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12910 Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_image.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index b08d6bdad7e..9fc244b79e3 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -505,8 +505,7 @@ anv_formats_ccs_e_compatible(const struct anv_physical_device *physical_device, return false; } - if ((vk_usage & VK_IMAGE_USAGE_STORAGE_BIT) && - vk_tiling != VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) { + if (vk_usage & VK_IMAGE_USAGE_STORAGE_BIT) { /* Only color */ assert((vk_format_aspects(vk_format) & ~VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) == 0); if (devinfo->ver == 12) { @@ -522,8 +521,13 @@ anv_formats_ccs_e_compatible(const struct anv_physical_device *physical_device, * On gfx12.0, compression is not supported with atomic * operations. On gfx12.5, the support is there, but it's slow * (see HSD 1406337848). + * + * We only care about the non-modifier case. Modifier capabilities + * are exposed via the standard interfaces and unlike prior + * platforms, we don't enable compression for uncompressed modifiers. */ - if (image_may_use_r32_view(create_flags, vk_format, fmt_list)) + if (vk_tiling != VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT && + image_may_use_r32_view(create_flags, vk_format, fmt_list)) return false; } else if (devinfo->ver <= 11) {