return false;
}
- if (!(res->aux.has_hiz & (1 << level)))
+ if (!iris_resource_level_has_hiz(res, level))
return false;
if (!blorp_can_hiz_clear_depth(devinfo, &res->surf, res->aux.usage,
iris_resource_level_has_hiz(const struct iris_resource *res, uint32_t level)
{
iris_resource_check_level_layer(res, level, 0);
- return res->aux.has_hiz & 1 << level;
+
+ if (!isl_aux_usage_has_hiz(res->aux.usage))
+ return false;
+
+ /* Disable HiZ for LOD > 0 unless the width/height are 8x4 aligned.
+ * For LOD == 0, we can grow the dimensions to make it work.
+ */
+ if (level > 0) {
+ if (u_minify(res->base.width0, level) & 7)
+ return false;
+
+ if (u_minify(res->base.height0, level) & 3)
+ return false;
+ }
+
+ return true;
}
/** \brief Assert that the level and layer are valid for the resource. */
res->aux.usage = ISL_AUX_USAGE_NONE;
res->aux.possible_usages = 1 << ISL_AUX_USAGE_NONE;
res->aux.sampler_usages = 1 << ISL_AUX_USAGE_NONE;
- res->aux.has_hiz = 0;
res->aux.surf.size_B = 0;
res->aux.bo = NULL;
res->aux.extra_aux.surf.size_B = 0;
if (!res->aux.state)
return false;
- if (isl_aux_usage_has_hiz(res->aux.usage)) {
- for (unsigned level = 0; level < res->surf.levels; ++level) {
- uint32_t width = u_minify(res->surf.phys_level0_sa.width, level);
- uint32_t height = u_minify(res->surf.phys_level0_sa.height, level);
-
- /* Disable HiZ for LOD > 0 unless the width/height are 8x4 aligned.
- * For LOD == 0, we can grow the dimensions to make it work.
- */
- if (level == 0 || ((width & 7) == 0 && (height & 3) == 0))
- res->aux.has_hiz |= 1 << level;
- }
- }
-
return true;
}
* aux state for each slice.
*/
enum isl_aux_state **state;
-
- /**
- * If (1 << level) is set, HiZ is enabled for that miplevel.
- */
- uint16_t has_hiz;
} aux;
/**