* select the image. So, instead, we just make a new single-level
* miptree and render into that.
*/
- struct intel_context *intel = intel_context(ctx);
- struct intel_texture_image *intel_image =
- intel_texture_image(irb->tex_image);
- struct intel_mipmap_tree *new_mt;
- int width, height, depth;
-
- intel_miptree_get_dimensions_for_image(irb->tex_image, &width, &height, &depth);
-
- new_mt = intel_miptree_create(intel, irb->tex_image->TexObject->Target,
- intel_image->base.Base.TexFormat,
- intel_image->base.Base.Level,
- intel_image->base.Base.Level,
- width, height, depth,
- true,
- 0 /* num_samples */,
- INTEL_MSAA_LAYOUT_NONE);
-
- intel_miptree_copy_teximage(intel, intel_image, new_mt);
- intel_miptree_reference(&irb->mt, intel_image->mt);
- intel_renderbuffer_set_draw_offset(irb);
- intel_miptree_release(&new_mt);
-
+ intel_renderbuffer_move_to_temp(intel, irb);
mt = irb->mt;
}
}
return false;
}
+void
+intel_renderbuffer_move_to_temp(struct intel_context *intel,
+ struct intel_renderbuffer *irb)
+{
+ struct intel_texture_image *intel_image =
+ intel_texture_image(irb->tex_image);
+ struct intel_mipmap_tree *new_mt;
+ int width, height, depth;
+
+ intel_miptree_get_dimensions_for_image(irb->tex_image, &width, &height, &depth);
+
+ new_mt = intel_miptree_create(intel, irb->tex_image->TexObject->Target,
+ intel_image->base.Base.TexFormat,
+ intel_image->base.Base.Level,
+ intel_image->base.Base.Level,
+ width, height, depth,
+ true,
+ irb->mt->num_samples,
+ irb->mt->msaa_layout);
+
+ intel_miptree_copy_teximage(intel, intel_image, new_mt);
+ intel_miptree_reference(&irb->mt, intel_image->mt);
+ intel_renderbuffer_set_draw_offset(irb);
+ intel_miptree_release(&new_mt);
+}
+
/**
* Do one-time context initializations related to GL_EXT_framebuffer_object.
* Hook in device driver functions.
intel_renderbuffer_resolve_depth(struct intel_context *intel,
struct intel_renderbuffer *irb);
+void intel_renderbuffer_move_to_temp(struct intel_context *intel,
+ struct intel_renderbuffer *irb);
+
unsigned
intel_quantize_num_samples(struct intel_screen *intel, unsigned num_samples);