summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel/intel_fbo.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-08-08 09:29:46 -0700
committerEric Anholt <[email protected]>2012-10-16 13:13:44 -0700
commitddfa346e4a685269c576714eb0b14fd23d748217 (patch)
treedfb4327c3a7c440cc356b93711ca089a5501d030 /src/mesa/drivers/dri/intel/intel_fbo.c
parent4bec2e31bfb6aad5b3af16f463211e51d1e67217 (diff)
i965: Make a helper function for the renderbuffer temporary mt workaround.
We now have a case of wanting to do that on gen6+ as well, so make this logic usable elsewhere. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_fbo.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index feac7024583..10a8c7fac39 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -936,6 +936,32 @@ intel_renderbuffer_resolve_depth(struct intel_context *intel,
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.