From: Marek Olšák Date: Thu, 9 Aug 2012 15:21:56 +0000 (+0200) Subject: r600g: implement copying between MSAA textures X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=870af19d70bf985a253f1ea8398fb7ec8704cf9c;p=mesa.git r600g: implement copying between MSAA textures --- diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c index 547386dfc74..f3a3b8f89bf 100644 --- a/src/gallium/drivers/r600/r600_blit.c +++ b/src/gallium/drivers/r600/r600_blit.c @@ -548,6 +548,7 @@ static void r600_resource_copy_region(struct pipe_context *ctx, struct pipe_box sbox; const struct pipe_box *psbox = src_box; boolean restore_orig[2]; + unsigned last_sample, i; memset(orig_info, 0, sizeof(orig_info)); @@ -557,6 +558,9 @@ static void r600_resource_copy_region(struct pipe_context *ctx, return; } + assert(u_max_sample(dst) == u_max_sample(src)); + last_sample = u_max_sample(dst); + /* This must be done before entering u_blitter to avoid recursion. */ if (rsrc->is_depth && !rsrc->is_flushing_texture) { if (!r600_init_flushed_depth_texture(ctx, src, NULL)) @@ -613,10 +617,12 @@ static void r600_resource_copy_region(struct pipe_context *ctx, restore_orig[1] = TRUE; } - r600_blitter_begin(ctx, R600_COPY_TEXTURE); - util_blitter_copy_texture(rctx->blitter, dst, dst_level, ~0, dstx, dsty, dstz, - src, src_level, 0, psbox); - r600_blitter_end(ctx); + for (i = 0; i <= last_sample; i++) { + r600_blitter_begin(ctx, R600_COPY_TEXTURE); + util_blitter_copy_texture(rctx->blitter, dst, dst_level, 1 << i, dstx, dsty, dstz, + src, src_level, i, psbox); + r600_blitter_end(ctx); + } if (restore_orig[0]) r600_reset_blittable_to_orig(src, src_level, &orig_info[0]);