diff options
author | Marek Olšák <[email protected]> | 2013-06-30 14:55:06 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2013-07-08 20:25:18 +0200 |
commit | 94d294137eea57a5200a62e53abc5d5ae787b9dd (patch) | |
tree | d54ace5301fb62a19701bd23c40fcd0b2e2f88c2 /src/gallium/drivers/r600/r600_texture.c | |
parent | 141b892620f9407ffeecfbc931e5dd879e0388c6 (diff) |
r600g: don't read back the MSAA depth buffer if the read flag is not set
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_texture.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_texture.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 5ad8c6521bf..36cca17eb11 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -865,24 +865,24 @@ static void *r600_texture_transfer_map(struct pipe_context *ctx, * * Only the region being mapped is transfered. */ - struct pipe_resource *temp; struct pipe_resource resource; r600_init_temp_resource_from_box(&resource, texture, box, level, 0); - temp = ctx->screen->resource_create(ctx->screen, &resource); - r600_copy_region_with_blit(ctx, temp, 0, 0, 0, 0, texture, level, box); - - if (!r600_init_flushed_depth_texture(ctx, temp, &staging_depth)) { + if (!r600_init_flushed_depth_texture(ctx, &resource, &staging_depth)) { R600_ERR("failed to create temporary texture to hold untiled copy\n"); FREE(trans); return NULL; } - r600_blit_decompress_depth(ctx, (struct r600_texture*)temp, staging_depth, - 0, 0, 0, box->depth, 0, 0); + if (usage & PIPE_TRANSFER_READ) { + struct pipe_resource *temp = ctx->screen->resource_create(ctx->screen, &resource); - pipe_resource_reference((struct pipe_resource**)&temp, NULL); + r600_copy_region_with_blit(ctx, temp, 0, 0, 0, 0, texture, level, box); + r600_blit_decompress_depth(ctx, (struct r600_texture*)temp, staging_depth, + 0, 0, 0, box->depth, 0, 0); + pipe_resource_reference((struct pipe_resource**)&temp, NULL); + } } else { /* XXX: only readback the rectangle which is being mapped? */ |