aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-08-09 17:21:56 +0200
committerMarek Olšák <[email protected]>2012-08-15 19:20:58 +0200
commit870af19d70bf985a253f1ea8398fb7ec8704cf9c (patch)
tree69c60dd310ea08ec0eb8465cf0df8d841f3057e8
parent0f86915c5322b096b7154b6c84e21288074b775d (diff)
r600g: implement copying between MSAA textures
-rw-r--r--src/gallium/drivers/r600/r600_blit.c14
1 files changed, 10 insertions, 4 deletions
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]);