*dst = src;
}
+static void
+intel_miptree_hiz_buffer_free(struct intel_miptree_hiz_buffer *hiz_buf)
+{
+ if (hiz_buf == NULL)
+ return;
+
+ if (hiz_buf->mt)
+ intel_miptree_release(&hiz_buf->mt);
+ else
+ drm_intel_bo_unreference(hiz_buf->aux_base.bo);
+
+ free(hiz_buf);
+}
void
intel_miptree_release(struct intel_mipmap_tree **mt)
drm_intel_bo_unreference((*mt)->bo);
intel_miptree_release(&(*mt)->stencil_mt);
intel_miptree_release(&(*mt)->r8stencil_mt);
- if ((*mt)->hiz_buf) {
- if ((*mt)->hiz_buf->mt)
- intel_miptree_release(&(*mt)->hiz_buf->mt);
- else
- drm_intel_bo_unreference((*mt)->hiz_buf->aux_base.bo);
- free((*mt)->hiz_buf);
- }
+ intel_miptree_hiz_buffer_free((*mt)->hiz_buf);
if ((*mt)->mcs_buf) {
drm_intel_bo_unreference((*mt)->mcs_buf->bo);
free((*mt)->mcs_buf);
* Fast color clears are unsafe with shared buffers, so we need to resolve and
* then discard the MCS buffer, if present. We also set the no_ccs flag to
* ensure that no MCS buffer gets allocated in the future.
+ *
+ * HiZ is similarly unsafe with shared buffers.
*/
void
intel_miptree_make_shareable(struct brw_context *brw,
mt->mcs_buf = NULL;
}
+ if (mt->hiz_buf) {
+ intel_miptree_all_slices_resolve_depth(brw, mt);
+ intel_miptree_hiz_buffer_free(mt->hiz_buf);
+ mt->hiz_buf = NULL;
+ }
+
mt->disable_aux_buffers = true;
}