switch (res->aux.usage) {
case ISL_AUX_USAGE_HIZ:
- assert(res->surf.format == view_format);
- if (iris_sample_with_depth_aux(devinfo, res))
- return ISL_AUX_USAGE_HIZ;
- break;
-
case ISL_AUX_USAGE_HIZ_CCS:
- assert(res->surf.format == view_format);
- assert(!iris_sample_with_depth_aux(devinfo, res));
- return ISL_AUX_USAGE_NONE;
-
case ISL_AUX_USAGE_HIZ_CCS_WT:
assert(res->surf.format == view_format);
- if (iris_sample_with_depth_aux(devinfo, res))
- return ISL_AUX_USAGE_HIZ_CCS_WT;
- break;
+ return util_last_bit(res->aux.sampler_usages) - 1;
case ISL_AUX_USAGE_MCS:
case ISL_AUX_USAGE_MCS_CCS:
res->aux.usage = util_last_bit(res->aux.possible_usages) - 1;
- res->aux.sampler_usages = res->aux.possible_usages;
-
- /* We don't always support sampling with hiz. But when we do, it must be
- * single sampled.
- */
- if (!devinfo->has_sample_with_hiz || res->surf.samples > 1)
- res->aux.sampler_usages &= ~(1 << ISL_AUX_USAGE_HIZ);
-
- /* ISL_AUX_USAGE_HIZ_CCS doesn't support sampling at all */
- res->aux.sampler_usages &= ~(1 << ISL_AUX_USAGE_HIZ_CCS);
+ if (!has_hiz || iris_sample_with_depth_aux(devinfo, res))
+ res->aux.sampler_usages = res->aux.possible_usages;
enum isl_aux_state initial_state;
assert(!res->aux.bo);