anv: Enable storage accesses with modifiers on gfx12+

I tested this patch with an ACM card. It enables "Halo: The Master Chief
Collection" to use the clear color modifier instead falling back to the
uncompressed Tile4 modifier.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32192>
This commit is contained in:
Nanley Chery 2024-11-04 16:07:36 -05:00 committed by Marge Bot
parent 2dedd8dbb2
commit 01c4ea771c
2 changed files with 15 additions and 6 deletions

View file

@ -836,11 +836,19 @@ anv_get_image_format_features2(const struct anv_physical_device *physical_device
*/ */
flags &= ~VK_FORMAT_FEATURE_2_DISJOINT_BIT; flags &= ~VK_FORMAT_FEATURE_2_DISJOINT_BIT;
/* When the hardware accesses a storage image, it bypasses the aux /* Gfx11 and prior bypass the aux surface when accessing storage
* surface. We could support storage access on images with aux * images. We could support storage access on images with aux
* modifiers by resolving the aux surface prior to the storage access. * modifiers by resolving the aux surface prior to the storage
* access.
*/ */
if (devinfo->ver <= 11)
flags &= ~VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT; flags &= ~VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT;
/* Starting with gfx12.5, atomics are supported with compression.
* However, the performance of this combination is slow on gfx12.5.
* So, only allow atomic support on Xe2+.
*/
if (devinfo->verx10 <= 125)
flags &= ~VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT; flags &= ~VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT;
/* Host transfer don't touch the AUX data, so if that is required by /* Host transfer don't touch the AUX data, so if that is required by

View file

@ -539,7 +539,8 @@ anv_formats_ccs_e_compatible(const struct intel_device_info *devinfo,
format, vk_tiling, fmt_list)) format, vk_tiling, fmt_list))
return false; return false;
if (vk_usage & VK_IMAGE_USAGE_STORAGE_BIT) { if ((vk_usage & VK_IMAGE_USAGE_STORAGE_BIT) &&
vk_tiling != VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) {
if (devinfo->verx10 < 125) if (devinfo->verx10 < 125)
return false; return false;