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: 01c4ea771c ("anv: Enable storage accesses with modifiers on gfx12+")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12910
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38855>
This commit is contained in:
Nanley Chery 2025-12-08 13:09:14 -05:00 committed by Marge Bot
parent 7bd238fa5a
commit fe372f3b1b

View file

@ -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) {