break;
return false;
case ISL_AUX_USAGE_HIZ_CCS:
- /* Write through mode must have been enabled for prior writes. */
- if (isl_surf_supports_hiz_ccs_wt(devinfo, &res->surf, res->aux.usage))
- break;
return false;
+ case ISL_AUX_USAGE_HIZ_CCS_WT:
+ break;
default:
return false;
}
break;
case ISL_AUX_USAGE_HIZ_CCS:
+ assert(!iris_sample_with_depth_aux(devinfo, res));
+ return ISL_AUX_USAGE_NONE;
+
+ case ISL_AUX_USAGE_HIZ_CCS_WT:
if (iris_sample_with_depth_aux(devinfo, res))
- return ISL_AUX_USAGE_CCS_E;
+ return ISL_AUX_USAGE_HIZ_CCS_WT;
break;
case ISL_AUX_USAGE_MCS:
res->aux.possible_usages |=
1 << (has_ccs ? ISL_AUX_USAGE_MCS_CCS : ISL_AUX_USAGE_MCS);
} else if (has_hiz) {
- res->aux.possible_usages |=
- 1 << (has_ccs ? ISL_AUX_USAGE_HIZ_CCS : ISL_AUX_USAGE_HIZ);
+ if (!has_ccs) {
+ res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ;
+ } else if (res->surf.samples == 1 &&
+ (res->surf.usage & ISL_SURF_USAGE_TEXTURE_BIT)) {
+ /* If this resource is single-sampled and will be used as a texture,
+ * put the HiZ surface in write-through mode so that we can sample
+ * from it.
+ */
+ res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ_CCS_WT;
+ } else {
+ res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ_CCS;
+ }
} else if (has_ccs) {
if (want_ccs_e_for_format(devinfo, res->surf.format))
res->aux.possible_usages |= 1 << ISL_AUX_USAGE_CCS_E;
if (!devinfo->has_sample_with_hiz || res->surf.samples > 1)
res->aux.sampler_usages &= ~(1 << ISL_AUX_USAGE_HIZ);
- /* We don't always support sampling with HIZ_CCS. But when we do, treat it
- * as CCS_E.*/
+ /* ISL_AUX_USAGE_HIZ_CCS doesn't support sampling at all */
res->aux.sampler_usages &= ~(1 << ISL_AUX_USAGE_HIZ_CCS);
- if (isl_surf_supports_hiz_ccs_wt(devinfo, &res->surf, res->aux.usage))
- res->aux.sampler_usages |= 1 << ISL_AUX_USAGE_CCS_E;
enum isl_aux_state initial_state;
*aux_size_B = 0;
return !res->mod_info || res->mod_info->aux_usage == ISL_AUX_USAGE_NONE;
case ISL_AUX_USAGE_HIZ:
case ISL_AUX_USAGE_HIZ_CCS:
+ case ISL_AUX_USAGE_HIZ_CCS_WT:
initial_state = ISL_AUX_STATE_AUX_INVALID;
break;
case ISL_AUX_USAGE_MCS:
if (x0 % align_px_w || y0 % align_px_h ||
x1 % align_px_w || y1 % align_px_h)
return false;
- } else if (isl_surf_supports_hiz_ccs_wt(devinfo, surf, aux_usage)) {
+ } else if (aux_usage == ISL_AUX_USAGE_HIZ_CCS_WT) {
/* We have to set the WM_HZ_OP::FullSurfaceDepthandStencilClear bit
* whenever we clear an uninitialized HIZ buffer (as some drivers
* currently do). However, this bit seems liable to clear 16x8 pixels in