Module: Mesa Branch: main Commit: 963847735a7bd642292ef251416b55d0f726540b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=963847735a7bd642292ef251416b55d0f726540b
Author: Rohan Garg <[email protected]> Date: Tue May 9 20:17:13 2023 +0200 isl: add helper to check if aux usage is CCS_E Signed-off-by: Rohan Garg <[email protected]> Reviewed-by: Nanley Chery <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22076> --- src/intel/isl/isl.h | 7 +++++++ src/intel/isl/isl_surface_state.c | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h index 442c0fc08ed..f0b943fabd9 100644 --- a/src/intel/isl/isl.h +++ b/src/intel/isl/isl.h @@ -2210,6 +2210,13 @@ isl_aux_usage_has_ccs(enum isl_aux_usage usage) usage == ISL_AUX_USAGE_STC_CCS; } +static inline bool +isl_aux_usage_has_ccs_e(enum isl_aux_usage usage) +{ + return usage == ISL_AUX_USAGE_CCS_E || + usage == ISL_AUX_USAGE_GFX12_CCS_E; +} + static inline bool isl_aux_state_has_valid_primary(enum isl_aux_state state) { diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c index 72f433bc093..90cd6403c50 100644 --- a/src/intel/isl/isl_surface_state.c +++ b/src/intel/isl/isl_surface_state.c @@ -695,8 +695,7 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state, * * If CCS_E is in use, the format must support it. */ - if (info->aux_usage == ISL_AUX_USAGE_CCS_E || - info->aux_usage == ISL_AUX_USAGE_GFX12_CCS_E) + if (isl_aux_usage_has_ccs_e(info->aux_usage)) assert(isl_format_supports_ccs_e(dev->info, info->view->format)); /* It also says:
