intel/isl: Define a CMF for ASTC formats

These formats are not supported natively on gfx20+. However, with a
driconf option enabled, we do create surfaces with these formats and use
them for transfer and decompression operations. Provide a CMF for these
formats to avoid hitting the unreachable in
isl_get_render_compression_format().

Fixes: 27d515772e ("intel/isl: Replace mc_format with aux_format")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/15547
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41830>
This commit is contained in:
Nanley Chery 2026-05-27 09:15:06 -04:00 committed by Marge Bot
parent f7321be05a
commit 6d0b1ebd3d

View file

@ -331,6 +331,40 @@ isl_get_render_compression_format(enum isl_format format)
case ISL_FORMAT_BC7_UNORM_SRGB:
case ISL_FORMAT_BC6H_UF16:
return CMF_ML8;
/* These formats are not in the CMF table in the Bspec 63919 (r60413).
* Although they are not supported for sampling, they are reinterpreted and
* used for transfer operations. Use the same CMF that we use for the other
* compressed formats.
*/
case ISL_FORMAT_ASTC_LDR_2D_4X4_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_5X4_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_5X5_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_6X5_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_6X6_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_8X5_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_8X6_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_8X8_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_10X5_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_10X6_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_10X8_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_10X10_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_12X10_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_12X12_U8SRGB:
case ISL_FORMAT_ASTC_LDR_2D_4X4_FLT16:
case ISL_FORMAT_ASTC_LDR_2D_5X4_FLT16:
case ISL_FORMAT_ASTC_LDR_2D_5X5_FLT16:
case ISL_FORMAT_ASTC_LDR_2D_6X5_FLT16:
case ISL_FORMAT_ASTC_LDR_2D_6X6_FLT16:
case ISL_FORMAT_ASTC_LDR_2D_8X5_FLT16:
case ISL_FORMAT_ASTC_LDR_2D_8X6_FLT16:
case ISL_FORMAT_ASTC_LDR_2D_8X8_FLT16:
case ISL_FORMAT_ASTC_LDR_2D_10X5_FLT16:
case ISL_FORMAT_ASTC_LDR_2D_10X6_FLT16:
case ISL_FORMAT_ASTC_LDR_2D_10X8_FLT16:
case ISL_FORMAT_ASTC_LDR_2D_10X10_FLT16:
case ISL_FORMAT_ASTC_LDR_2D_12X10_FLT16:
case ISL_FORMAT_ASTC_LDR_2D_12X12_FLT16:
return CMF_ML8;
/* These formats are not in the CMF table in the Bspec 63919 (r60413).
* We choose CMF values for them by their number of channels x channel bit
* size.