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>
This commit is contained in:
Alyssa Rosenzweig
2021-05-11 15:38:23 -04:00
committed by Marge Bot
parent 2c3e2d69bd
commit bff8c7e611
4 changed files with 17 additions and 4 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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