diff options
author | Rob Clark <[email protected]> | 2018-09-11 16:21:29 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2018-09-27 15:41:46 -0400 |
commit | 919741b8d5357b2a061a48f7142c1e24be8656d4 (patch) | |
tree | ba4d6279898c864973c8f37b08a9a00346a0243c /src/gallium/drivers/freedreno/freedreno_draw.c | |
parent | 19e9d286464d1941f731f0d84402725f918623d6 (diff) |
freedreno: handle invalidated buffers harder
Do a better job of skipping mem2gmem/gmem2mem..
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_draw.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_draw.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c index d5bb1e48bee..5a95880944b 100644 --- a/src/gallium/drivers/freedreno/freedreno_draw.c +++ b/src/gallium/drivers/freedreno/freedreno_draw.c @@ -137,16 +137,22 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) mtx_lock(&ctx->screen->lock); if (fd_depth_enabled(ctx)) { - if (fd_resource(pfb->zsbuf->texture)->valid) + if (fd_resource(pfb->zsbuf->texture)->valid) { restore_buffers |= FD_BUFFER_DEPTH; + } else { + batch->invalidated |= FD_BUFFER_DEPTH; + } buffers |= FD_BUFFER_DEPTH; resource_written(batch, pfb->zsbuf->texture); batch->gmem_reason |= FD_GMEM_DEPTH_ENABLED; } if (fd_stencil_enabled(ctx)) { - if (fd_resource(pfb->zsbuf->texture)->valid) + if (fd_resource(pfb->zsbuf->texture)->valid) { restore_buffers |= FD_BUFFER_STENCIL; + } else { + batch->invalidated |= FD_BUFFER_STENCIL; + } buffers |= FD_BUFFER_STENCIL; resource_written(batch, pfb->zsbuf->texture); batch->gmem_reason |= FD_GMEM_STENCIL_ENABLED; @@ -163,10 +169,13 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) surf = pfb->cbufs[i]->texture; - resource_written(batch, surf); - - if (fd_resource(surf)->valid) + if (fd_resource(surf)->valid) { restore_buffers |= PIPE_CLEAR_COLOR0 << i; + } else { + batch->invalidated |= PIPE_CLEAR_COLOR0 << i; + } + + resource_written(batch, surf); buffers |= PIPE_CLEAR_COLOR0 << i; @@ -242,7 +251,7 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) ctx->stats.prims_generated += prims; /* any buffers that haven't been cleared yet, we need to restore: */ - batch->restore |= restore_buffers & (FD_BUFFER_ALL & ~batch->cleared); + batch->restore |= restore_buffers & (FD_BUFFER_ALL & ~batch->invalidated); /* and any buffers used, need to be resolved: */ batch->resolve |= buffers; @@ -372,6 +381,7 @@ fd_clear(struct pipe_context *pctx, unsigned buffers, */ cleared_buffers = buffers & (FD_BUFFER_ALL & ~batch->restore); batch->cleared |= cleared_buffers; + batch->invalidated |= cleared_buffers; batch->resolve |= buffers; batch->needs_flush = true; |