}
}
-void
+bool
brw_miptree_layout(struct brw_context *brw,
struct intel_mipmap_tree *mt,
uint32_t layout_flags)
intel_miptree_set_alignment(brw, mt, layout_flags);
intel_miptree_set_total_width_height(brw, mt);
- if (!mt->total_width || !mt->total_height) {
- intel_miptree_release(&mt);
- return;
- }
+ if (!mt->total_width || !mt->total_height)
+ return false;
/* On Gen9+ the alignment values are expressed in multiples of the block
* size
if ((layout_flags & MIPTREE_LAYOUT_FOR_BO) == 0)
mt->tiling = brw_miptree_choose_tiling(brw, mt, layout_flags);
+
+ return true;
}
(layout_flags & MIPTREE_LAYOUT_FORCE_HALIGN16) == 0);
}
- brw_miptree_layout(brw, mt, layout_flags);
+ if (!brw_miptree_layout(brw, mt, layout_flags)) {
+ intel_miptree_release(&mt);
+ return NULL;
+ }
if (mt->aux_disable & INTEL_AUX_DISABLE_MCS)
assert(mt->msaa_layout != INTEL_MSAA_LAYOUT_CMS);