diff options
author | Alyssa Rosenzweig <alyssa@collabora.com> | 2021-05-11 15:38:23 -0400 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-05-12 12:47:53 +0000 |
commit | bff8c7e611a26a8fad5d603ff9c33fbac48788f5 (patch) | |
tree | 67daaa3e3b60b3f3566ed68607ded576813a9bef /src/gallium/drivers | |
parent | 2c3e2d69bd1e1ab715783f0ef41daf99519ed12e (diff) |
panfrost: Track buffers needing resolve
This is a subset of the buffers cleared or drawed.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6295>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_blit.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_cmdstream.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_job.c | 9 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_job.h | 3 |
4 files changed, 17 insertions, 4 deletions
diff --git a/src/gallium/drivers/panfrost/pan_blit.c b/src/gallium/drivers/panfrost/pan_blit.c index 10545eedd06..da12004f66d 100644 --- a/src/gallium/drivers/panfrost/pan_blit.c +++ b/src/gallium/drivers/panfrost/pan_blit.c @@ -289,6 +289,7 @@ panfrost_blit(struct pipe_context *pipe, panfrost_batch_add_fbo_bos(batch); panfrost_blit_add_ctx_bos(batch, &bctx); batch->draws = draw_flags; + batch->resolve = draw_flags; batch->minx = minx; batch->miny = miny; batch->maxx = maxx; diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index b7ed0442248..35cb02d62ab 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -426,8 +426,10 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts, panfrost_emit_midgard_blend(batch, blend, rts); for (unsigned i = 0; i < batch->key.nr_cbufs; ++i) { - if (!blend[i].no_colour && batch->key.cbufs[i]) + if (!blend[i].no_colour && batch->key.cbufs[i]) { batch->draws |= (PIPE_CLEAR_COLOR0 << i); + batch->resolve |= (PIPE_CLEAR_COLOR0 << i); + } } } @@ -696,8 +698,10 @@ panfrost_emit_frag_shader_meta(struct panfrost_batch *batch) if (!(dev->quirks & MIDGARD_SFBD)) panfrost_emit_blend(batch, xfer.cpu + MALI_RENDERER_STATE_LENGTH, blend); - else + else { batch->draws |= PIPE_CLEAR_COLOR0; + batch->resolve |= PIPE_CLEAR_COLOR0; + } if (ctx->depth_stencil->base.depth_enabled) batch->read |= PIPE_CLEAR_DEPTH; diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 60bce5d5283..ba8f8aa011d 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -1276,12 +1276,16 @@ void panfrost_batch_set_requirements(struct panfrost_batch *batch) { struct panfrost_context *ctx = batch->ctx; + unsigned draws = 0; if (ctx->depth_stencil && ctx->depth_stencil->base.depth_writemask) - batch->draws |= PIPE_CLEAR_DEPTH; + draws |= PIPE_CLEAR_DEPTH; if (ctx->depth_stencil && ctx->depth_stencil->base.stencil[0].enabled) - batch->draws |= PIPE_CLEAR_STENCIL; + draws |= PIPE_CLEAR_STENCIL; + + batch->draws |= draws; + batch->resolve |= draws; } void @@ -1414,6 +1418,7 @@ panfrost_batch_clear(struct panfrost_batch *batch, } batch->clear |= buffers; + batch->resolve |= buffers; /* Clearing affects the entire framebuffer (by definition -- this is * the Gallium clear callback, which clears the whole framebuffer. If diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h index fcb79489ae4..70a4a54c4b3 100644 --- a/src/gallium/drivers/panfrost/pan_job.h +++ b/src/gallium/drivers/panfrost/pan_job.h @@ -65,6 +65,9 @@ struct panfrost_batch { /* Buffers read */ unsigned read; + /* Buffers needing resolve to memory */ + unsigned resolve; + /* Packed clear values, indexed by both render target as well as word. * Essentially, a single pixel is packed, with some padding to bring it * up to a 32-bit interval; that pixel is then duplicated over to fill |