From 6d0b1ebd3d5a674e26dce5bed6a7d4af68c65ed9 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Wed, 27 May 2026 09:15:06 -0400 Subject: [PATCH] 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: 27d515772e0 ("intel/isl: Replace mc_format with aux_format") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/15547 Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/isl/isl_genX_helpers.h | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/intel/isl/isl_genX_helpers.h b/src/intel/isl/isl_genX_helpers.h index 3a171d948a9..c95de96cf18 100644 --- a/src/intel/isl/isl_genX_helpers.h +++ b/src/intel/isl/isl_genX_helpers.h @@ -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.