aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
diff options
context:
space:
mode:
authorLucas Stach <[email protected]>2016-11-21 12:25:29 +0100
committerLucas Stach <[email protected]>2017-04-11 16:52:01 +0200
commit37622ecc795e655ab0264c44dbe6188d9d9d3813 (patch)
tree485a884920edb1e284d33ab25bf691b939562cb0 /src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
parent768f81b62ba0901b766494af7a29ba9deee83338 (diff)
etnaviv: avoid using invalid TS
The TS is only valid after it has been initialized by a fast clear, so it should not be taken into account when blitting resources that haven't been cleared. Also the blit itself invalidates the destination TS, as it's not updated and will retain data from the previous rendering after the blit. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_clear_blit.c')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_clear_blit.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
index 4a03d8294f5..d555884d3fe 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
@@ -119,6 +119,7 @@ etna_blit_clear_color(struct pipe_context *pctx, struct pipe_surface *dst,
ctx->framebuffer.TS_MEM_CONFIG |= VIVS_TS_MEM_CONFIG_COLOR_AUTO_DISABLE;
}
+ surf->level->ts_valid = true;
ctx->dirty |= ETNA_DIRTY_TS;
} else if (unlikely(new_clear_value != surf->level->clear_value)) { /* Queue normal RS clear for non-TS surfaces */
/* If clear color changed, re-generate stored command */
@@ -178,6 +179,7 @@ etna_blit_clear_zs(struct pipe_context *pctx, struct pipe_surface *dst,
ctx->framebuffer.TS_MEM_CONFIG |= VIVS_TS_MEM_CONFIG_DEPTH_AUTO_DISABLE;
}
+ surf->level->ts_valid = true;
ctx->dirty |= ETNA_DIRTY_TS;
} else {
if (unlikely(new_clear_value != surf->level->clear_value)) { /* Queue normal RS clear for non-TS surfaces */
@@ -468,7 +470,8 @@ etna_try_rs_blit(struct pipe_context *pctx,
}
/* Set up color TS to source surface before blit, if needed */
- if (src->levels[blit_info->src.level].ts_size) {
+ if (src->levels[blit_info->src.level].ts_size &&
+ src->levels[blit_info->src.level].ts_valid) {
struct etna_reloc reloc;
unsigned ts_offset =
src_lev->ts_offset + blit_info->src.box.z * src_lev->ts_layer_stride;
@@ -521,6 +524,7 @@ etna_try_rs_blit(struct pipe_context *pctx,
etna_submit_rs_state(ctx, &copy_to_screen);
resource_written(ctx, &dst->base);
dst->seqno++;
+ dst->levels[blit_info->dst.level].ts_valid = false;
return TRUE;