summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_blit.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-08-23 16:46:53 +0200
committerMarek Olšák <[email protected]>2014-09-01 21:18:52 +0200
commita10c8db715baa8e12f5267ef2fc59dbb7d191f8d (patch)
tree4b38e33d7ab31462a105f7f442a3598c238f75b0 /src/gallium/drivers/radeonsi/si_blit.c
parentf05fe294e7e8dfb08be172f426252192c0ba17ab (diff)
radeonsi: implement EXPCLEAR optimization for depth
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_blit.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_blit.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index 4e77d74a79f..96d27ec062f 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -362,6 +362,12 @@ static void si_clear(struct pipe_context *ctx, unsigned buffers,
zsbuf->u.tex.level == 0 &&
zsbuf->u.tex.first_layer == 0 &&
zsbuf->u.tex.last_layer == util_max_layer(&zstex->resource.b.b, 0)) {
+ /* Need to disable EXPCLEAR temporarily if clearing
+ * to a new value. */
+ if (zstex->depth_cleared && zstex->depth_clear_value != depth) {
+ sctx->db_depth_disable_expclear = true;
+ }
+
zstex->depth_clear_value = depth;
sctx->framebuffer.atom.dirty = true; /* updates DB_DEPTH_CLEAR */
sctx->db_depth_clear = true;
@@ -373,7 +379,11 @@ static void si_clear(struct pipe_context *ctx, unsigned buffers,
buffers, color, depth, stencil);
si_blitter_end(ctx);
- sctx->db_depth_clear = false;
+ if (sctx->db_depth_clear) {
+ sctx->db_depth_clear = false;
+ sctx->db_depth_disable_expclear = false;
+ zstex->depth_cleared = true;
+ }
}
static void si_clear_render_target(struct pipe_context *ctx,