diff options
author | Marek Olšák <[email protected]> | 2012-07-08 01:54:24 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-07-12 02:08:30 +0200 |
commit | dee58f94af833906863b0ff2955b20f3ab407e63 (patch) | |
tree | 5099a89a659cd1d987977a3235c37e7a105a9a87 /src/gallium/drivers/r600/r600_texture.c | |
parent | df79eb59566f20a7fa8e11d87b63b81ec35eaf25 (diff) |
r600g: do fine-grained depth texture flushing
- maintain a mask of which mipmap levels are dirty (instead of one big flag)
- only flush what was requested at a given point and not the whole resource
(most often only one level and one layer has to be flushed)
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 | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index da6634643a3..c34df2daa71 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -754,7 +754,7 @@ void r600_init_flushed_depth_texture(struct pipe_context *ctx, if (staging) resource.flags |= R600_RESOURCE_FLAG_TRANSFER; else - rtex->dirty_db = TRUE; + rtex->dirty_db_mask = (1 << (resource.last_level+1)) - 1; *flushed_depth_texture = (struct r600_resource_texture *)ctx->screen->resource_create(ctx->screen, &resource); if (*flushed_depth_texture == NULL) { @@ -768,7 +768,9 @@ void r600_init_flushed_depth_texture(struct pipe_context *ctx, void r600_texture_depth_flush(struct pipe_context *ctx, struct pipe_resource *texture, - struct r600_resource_texture **staging) + struct r600_resource_texture **staging, + unsigned first_level, unsigned last_level, + unsigned first_layer, unsigned last_layer) { struct r600_resource_texture *rtex = (struct r600_resource_texture*)texture; @@ -778,12 +780,16 @@ void r600_texture_depth_flush(struct pipe_context *ctx, if (!*staging) return; /* error */ - r600_blit_uncompress_depth(ctx, rtex, *staging); + r600_blit_uncompress_depth(ctx, rtex, *staging, + first_level, last_level, + first_layer, last_layer); } else { if (!rtex->flushed_depth_texture) return; /* error */ - r600_blit_uncompress_depth(ctx, rtex, NULL); + r600_blit_uncompress_depth(ctx, rtex, NULL, + first_level, last_level, + first_layer, last_layer); } } @@ -850,7 +856,9 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, */ struct r600_resource_texture *staging_depth; - r600_texture_depth_flush(ctx, texture, &staging_depth); + r600_texture_depth_flush(ctx, texture, &staging_depth, + level, level, + box->z, box->z + box->depth - 1); if (!staging_depth) { R600_ERR("failed to create temporary texture to hold untiled copy\n"); pipe_resource_reference(&trans->transfer.resource, NULL); |