intel/isl: Simplify isl_format_supports_filtering

For compressed formats, filtering and sampling has always gone together.
This lets us avoid duplicating all those nasty special cases between the
two functions.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13206>
This commit is contained in:
Jason Ekstrand
2021-10-05 16:09:21 -05:00
committed by Marge Bot
parent 7cc85dba71
commit 0c618f308c

View File

@@ -746,27 +746,9 @@ isl_format_supports_filtering(const struct intel_device_info *devinfo,
if (!format_info_exists(format))
return false;
if (devinfo->is_baytrail) {
const struct isl_format_layout *fmtl = isl_format_get_layout(format);
/* Support for ETC1 and ETC2 exists on Bay Trail even though big-core
* GPUs didn't get it until Broadwell.
*/
if (fmtl->txc == ISL_TXC_ETC1 || fmtl->txc == ISL_TXC_ETC2)
return true;
} else if (devinfo->is_cherryview) {
const struct isl_format_layout *fmtl = isl_format_get_layout(format);
/* Support for ASTC LDR exists on Cherry View even though big-core
* GPUs didn't get it until Skylake.
*/
if (fmtl->txc == ISL_TXC_ASTC)
return format < ISL_FORMAT_ASTC_HDR_2D_4X4_FLT16;
} else if (intel_device_info_is_9lp(devinfo)) {
const struct isl_format_layout *fmtl = isl_format_get_layout(format);
/* Support for ASTC HDR exists on Broxton even though big-core
* GPUs didn't get it until Cannonlake.
*/
if (fmtl->txc == ISL_TXC_ASTC)
return true;
if (isl_format_is_compressed(format)) {
assert(format_info[format].filtering == format_info[format].sampling);
return isl_format_supports_sampling(devinfo, format);
}
return devinfo->verx10 >= format_info[format].filtering;