if (!irb->mt)
return false;
- if (intel->vtbl.is_hiz_depth_format(intel, rb->Format)) {
- bool ok = intel_miptree_alloc_hiz(intel, irb->mt, rb->NumSamples);
- if (!ok) {
- intel_miptree_release(&irb->mt);
- return false;
- }
- }
-
- if (irb->mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {
- bool ok = intel_miptree_alloc_mcs(intel, irb->mt, rb->NumSamples);
- if (!ok) {
- intel_miptree_release(&irb->mt);
- return false;
- }
- }
-
return true;
}
struct intel_mipmap_tree *mt;
uint32_t depth = 1;
enum intel_msaa_layout msaa_layout = INTEL_MSAA_LAYOUT_NONE;
+ bool ok;
if (num_samples > 1) {
/* Adjust width/height/depth for MSAA */
mt = intel_miptree_create(intel, GL_TEXTURE_2D, format, 0, 0,
width, height, depth, true, num_samples,
msaa_layout);
+ if (!mt)
+ goto fail;
+
+ if (intel->vtbl.is_hiz_depth_format(intel, format)) {
+ ok = intel_miptree_alloc_hiz(intel, mt, num_samples);
+ if (!ok)
+ goto fail;
+ }
+
+ if (mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {
+ ok = intel_miptree_alloc_mcs(intel, mt, num_samples);
+ if (!ok)
+ goto fail;
+ }
return mt;
+
+fail:
+ intel_miptree_release(&mt);
+ return NULL;
}
void