aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2019-08-09 10:55:46 -0400
committerChristian Gmeiner <[email protected]>2019-11-26 19:04:51 +0100
commit7806e058c9e62f0d8e8c275898b1962052a1691a (patch)
treebf3fcdba3a65d50b412e84187deec095eb641a51 /src
parent7cd548d3523b16a0e8f35c078316388016514d31 (diff)
etnaviv: blt: fix partial ZS clears with TS
If not all bits are cleared, then BLT needs to be given the current clear value and not the new one. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_blt.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_blt.c b/src/gallium/drivers/etnaviv/etnaviv_blt.c
index 08f74035c06..81217918d3b 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_blt.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_blt.c
@@ -291,6 +291,10 @@ etna_blit_clear_zs_blt(struct pipe_context *pctx, struct pipe_surface *dst,
if (buffers & PIPE_CLEAR_STENCIL)
new_clear_bits |= clear_bits_stencil;
+ /* if all bits are cleared, update TS clear value */
+ if (new_clear_bits == 0xffffffff)
+ surf->level->clear_value = new_clear_value;
+
/* TODO unduplicate this */
struct etna_resource *res = etna_resource(surf->base.texture);
struct blt_clear_op clr = {};
@@ -306,8 +310,8 @@ etna_blit_clear_zs_blt(struct pipe_context *pctx, struct pipe_surface *dst,
clr.dest.ts_addr.bo = res->ts_bo;
clr.dest.ts_addr.offset = 0;
clr.dest.ts_addr.flags = ETNA_RELOC_WRITE;
- clr.dest.ts_clear_value[0] = new_clear_value;
- clr.dest.ts_clear_value[1] = new_clear_value;
+ clr.dest.ts_clear_value[0] = surf->level->clear_value;
+ clr.dest.ts_clear_value[1] = surf->level->clear_value;
clr.dest.ts_mode = surf->level->ts_mode;
clr.dest.ts_compress_fmt = surf->level->ts_compress_fmt;
}
@@ -325,12 +329,11 @@ etna_blit_clear_zs_blt(struct pipe_context *pctx, struct pipe_surface *dst,
/* This made the TS valid */
if (surf->surf.ts_size) {
- ctx->framebuffer.TS_DEPTH_CLEAR_VALUE = new_clear_value;
+ ctx->framebuffer.TS_DEPTH_CLEAR_VALUE = surf->level->clear_value;
surf->level->ts_valid = true;
ctx->dirty |= ETNA_DIRTY_TS | ETNA_DIRTY_DERIVE_TS;
}
- surf->level->clear_value = new_clear_value;
resource_written(ctx, surf->base.texture);
etna_resource(surf->base.texture)->seqno++;
}