iris_get_ccs_surf(&screen->isl_dev, &res->surf, &res->aux.surf,
&res->aux.extra_aux.surf, 0);
- /* Having both HIZ and MCS is impossible. */
- assert(!has_mcs || !has_hiz);
-
- if (res->mod_info && has_ccs) {
- /* Only allow a CCS modifier if the aux was created successfully. */
- res->aux.possible_usages |= 1 << res->mod_info->aux_usage;
- } else if (has_mcs) {
+ if (has_mcs) {
assert(!res->mod_info);
- res->aux.possible_usages |=
- 1 << (has_ccs ? ISL_AUX_USAGE_MCS_CCS : ISL_AUX_USAGE_MCS);
+ assert(!has_hiz);
+ if (has_ccs) {
+ res->aux.possible_usages |= 1 << ISL_AUX_USAGE_MCS_CCS;
+ } else {
+ res->aux.possible_usages |= 1 << ISL_AUX_USAGE_MCS;
+ }
} else if (has_hiz) {
assert(!res->mod_info);
+ assert(!has_mcs);
if (!has_ccs) {
res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ;
} else if (res->surf.samples == 1 &&
} else {
res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ_CCS;
}
- } else if (has_ccs && isl_surf_usage_is_stencil(res->surf.usage)) {
- res->aux.possible_usages |= 1 << ISL_AUX_USAGE_STC_CCS;
} else if (has_ccs) {
- if (want_ccs_e_for_format(devinfo, res->surf.format)) {
+ if (res->mod_info) {
+ res->aux.possible_usages |= 1 << res->mod_info->aux_usage;
+ } else if (isl_surf_usage_is_stencil(res->surf.usage)) {
+ res->aux.possible_usages |= 1 << ISL_AUX_USAGE_STC_CCS;
+ } else if (want_ccs_e_for_format(devinfo, res->surf.format)) {
res->aux.possible_usages |= devinfo->ver < 12 ?
1 << ISL_AUX_USAGE_CCS_E : 1 << ISL_AUX_USAGE_GFX12_CCS_E;
} else if (isl_format_supports_ccs_d(devinfo, res->surf.format)) {