summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_blit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/r600/r600_blit.c')
-rw-r--r--src/gallium/drivers/r600/r600_blit.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c
index 4c72f16b701..d85324b6fbb 100644
--- a/src/gallium/drivers/r600/r600_blit.c
+++ b/src/gallium/drivers/r600/r600_blit.c
@@ -114,13 +114,17 @@ static unsigned u_num_layers(struct pipe_resource *r, unsigned level)
}
}
-void r600_blit_uncompress_depth(struct pipe_context *ctx, struct r600_resource_texture *texture)
+void r600_blit_uncompress_depth(struct pipe_context *ctx,
+ struct r600_resource_texture *texture,
+ struct r600_resource_texture *staging)
{
struct r600_context *rctx = (struct r600_context *)ctx;
unsigned layer, level;
float depth = 1.0f;
+ struct r600_resource_texture *flushed_depth_texture = staging ?
+ staging : texture->flushed_depth_texture;
- if (!texture->dirty_db)
+ if (!staging && !texture->dirty_db)
return;
if (rctx->family == CHIP_RV610 || rctx->family == CHIP_RV630 ||
@@ -141,10 +145,10 @@ void r600_blit_uncompress_depth(struct pipe_context *ctx, struct r600_resource_t
zsurf = ctx->create_surface(ctx, &texture->resource.b.b, &surf_tmpl);
- surf_tmpl.format = texture->flushed_depth_texture->real_format;
+ surf_tmpl.format = flushed_depth_texture->real_format;
surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
cbsurf = ctx->create_surface(ctx,
- (struct pipe_resource*)texture->flushed_depth_texture, &surf_tmpl);
+ (struct pipe_resource*)flushed_depth_texture, &surf_tmpl);
r600_blitter_begin(ctx, R600_DECOMPRESS);
util_blitter_custom_depth_stencil(rctx->blitter, zsurf, cbsurf, rctx->custom_dsa_flush, depth);
@@ -155,7 +159,8 @@ void r600_blit_uncompress_depth(struct pipe_context *ctx, struct r600_resource_t
}
}
- texture->dirty_db = FALSE;
+ if (!staging)
+ texture->dirty_db = FALSE;
}
void r600_flush_depth_textures(struct r600_context *rctx)
@@ -178,7 +183,7 @@ void r600_flush_depth_textures(struct r600_context *rctx)
if (tex->is_flushing_texture)
continue;
- r600_blit_uncompress_depth(&rctx->context, tex);
+ r600_blit_uncompress_depth(&rctx->context, tex, NULL);
}
/* also check CB here */
@@ -192,7 +197,7 @@ void r600_flush_depth_textures(struct r600_context *rctx)
if (tex->is_flushing_texture)
continue;
- r600_blit_uncompress_depth(&rctx->context, tex);
+ r600_blit_uncompress_depth(&rctx->context, tex, NULL);
}
}
@@ -324,7 +329,7 @@ static void r600_resource_copy_region(struct pipe_context *ctx,
}
if (rsrc->is_depth && !rsrc->is_flushing_texture)
- r600_texture_depth_flush(ctx, src);
+ r600_texture_depth_flush(ctx, src, NULL);
restore_orig[0] = restore_orig[1] = FALSE;